[Insight-users] Convert vtkImageData to itk Image

Jothy jothybasu at gmail.com
Wed Sep 7 12:27:16 EDT 2011


 Hi all,

I am trying to convert a vtkImageData into a itk image. I tried the
following as given in the itk examples wiki.

typedef itk::Image<float, 2> ImageType;

typedef itk::VTKImageToImageFilter<ImageType> VTKImageToImageType;

VTKImageToImageType::Pointer vtkImageToImageFilter = VTKImageToImageType::New();

vtkImageToImageFilter->SetInput(inputVTKImage);

vtkImageToImageFilter->Update();

 But the program crashes. I found in the users list that
VTKImageToImageFilter is not supposed to be used directly. I am new to
itk and it seems to be highly templated.
I am a novice new c++ user to decipher the itk templates fully. Is
there any easy to follow example on this?
Thanks

Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110907/e08abdb2/attachment.htm>


More information about the Insight-users mailing list