[Insight-users] ITK to VTK Image
Luis Ibanez
luis.ibanez at kitware.com
Wed Jul 28 16:25:45 EDT 2004
Hi Jacob,
This operation is very simple with ITK.
You just connect an ImageFileReader to
an ImageFileWriter. You code doesn't
have to make any mention of MetaImage
or VTK file formats. Just pass as input
a file with extension .mhd (or .mha) and
as output a filename with extension .vtk.
The IO Factory mechanism will do all the
magic for you.
In practice you can simply take the example
Insight/Examples/IO/
ImageReadWrite.cxx
That is described in the SoftwareGuide
http://www.itk.org/ItkSoftwareGuide.pdf
Chapter 7, pdf-page 219.
Eventually change the pixel type and image
dimension..., compile it and run it by
passing the input and output filenames
as command line arguments.
Regards,
Luis
---------------------------
Jacob Boomgaarden wrote:
> Hello All,
>
> Quick question here about trying to write a VTK image to a file.
> The small program I am trying to write reads in a MetaImage header file to create
> an itk::Image. I would then like to simply convert the image into a VTK image and
> then write the image to a file for later use with a VTK application.
>
> My question is what classes should I be using to accomplish the conversion and
> writing, and how should I design the short pipeline for doing this...I've looked
> through a few examples in ITK and am unsure of the setup.
>
> Thanks for the help,
>
>
>
More information about the Insight-users
mailing list