[vtkusers] how to convert insight image data to vtk image data

Thiha Oo thihaucsm at gmail.com
Thu Aug 18 21:42:49 EDT 2011


Hi,
  I used the following method to convert from IT to VTK. It may not be the
perfect codes but it works for me

typedef itk::OrientedImage< unsigned char, 3 > SegVolumeImageType;
typedef itk::ImageToVTKImageFilter<SegVolumeImageType>
ITKImageToVTKImageFilterType;

vtkSmartPointer<vtkImageData> segmentedVTKImage =
vtkSmartPointer<vtkImageData>::New();


//segmentedITKImage is a type of SegVolumeImageType

ITKImageToVTKImageFilterType::Pointer converter =
ITKImageToVTKImageFilterType::New();
converter->SetInput(segmentedITKImage);

segmentedVTKImage = converter->GetOutput();


Thiha


On Fri, Aug 19, 2011 at 9:24 AM, David Brayford <dbrayford at gmail.com> wrote:

> Hi,
>
> I've written a function to convert a vtk to itk image data, but know
> need a method of converting the itk image data back to a vtk image
> data. However, I don't know how to convert from itk to vtk.
>
> thanks
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110819/580d6dfb/attachment.htm>


More information about the vtkusers mailing list