[Insight-users] (no subject)
martin.garcia@epfl.ch
martin . garcia at epfl . ch
Thu, 29 Aug 2002 16:32:58 +0200
(Sorry for the first message it was truncated!!!!!)
HI everyone,
I'm trying to develop an application in order to produce medical images
segemntation and volume rendering. For visualisation I use vtk and I'd like to
use itk for segmentation.
To do this I've tried to use vtk2itk example , but I only could do it with
single 2D images.
2 questions:
1.Can I do import export from a volume file?
(I've got a vtkImageData object called m_pImageData with all the volumic data
(spacing, voxel size, image size,slice thickness...)that I' like to import into
itk and then export back to vtk.
sample code that uses itkvtktoitk example
typedef itk::Image<float, 3> ImageType;
typedef itk::VTKImageImport<ImageType> ImageImportType;
typedef itk::VTKImageExport<ImageType> ImageExportType;
vtkImageExport* vtkExporter = vtkImageExport::New();
vtkImageCast * imagecast = vtkImageCast::New();
imagecast->SetOutputScalarTypeToFloat();
imagecast->SetInput(m_pImageData->GetOutput());
vtkExporter->SetInput(imagecast->GetOutput());
ImageImportType::Pointer itkImporter = ImageImportType::New();
ConnectPipelines(vtkExporter, itkImporter);
//back to vtk
ImageExportType::Pointer itkExporter = ImageExportType::New();
itkExporter->SetInput(itkImporter->GetOutput());
// Create the vtkImageImport and connect it to the
// itk::VTKImageExport instance.
vtkImageImport* vtkImporter = vtkImageImport::New();
ConnectPipelines(itkExporter, vtkImporter);
vtkImageCast * imagecastbk = vtkImageCast::New();
imagecastbk->SetOutputScalarTypeToUnsignedChar();
imagecastbk->SetInput(vtkImporter->GetOutput());
m_pImageData->DeepCopy(imagecastbk->GetOutput());
Execution errors appear when Itry to visualize back the information (concerning
the extent update and the whole extent values)
2. Can I apply itk segmentation filters directly on 3 dimensional data
Image<float,3>(watershed, region growing,...?
Thanks, and sorry again for the truncated message
2.
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/