[Insight-users] VTK to ITK

Marta Kersten kersten at cs.queensu.ca
Thu Mar 2 04:13:06 EST 2006


Hi,

I'm having trouble converting a SLC vtk volume to an itk image. I am using
the
itk::VTKImageToImageFilter but whenever I try to set the input to the
filter I get a segmentation fault
(the code is below)... would anyone have any ideas?

Thanks,
Marta


// read SLC file
 vtkSLCReader *slcReader = vtkSLCReader::New();
slcReader->SetFileName(filename);
slcReader->Update();

vtkImageData *volume = slcReader->GetOutput();
volume->PrintSelf(std::cout, 4);

typedef  itk::Image<short,3>  ImageType;
typedef  itk::VTKImageToImageFilter<ImageType>    VtkToItkConnectorType;

VtkToItkConnectorType *filter = VtkToItkConnectorType::New();
filter->SetInput(volume);  /****************seg faults
here**********************/
filter->Update();

ImageType::ConstPointer itkImage = filter->GetOutput();
.....

--
http://www.kerstens.org/marta/





More information about the Insight-users mailing list