[Insight-users] 3D Registration: converter, casting and extension problem

Luis Ibanez luis.ibanez at kitware.com
Tue Mar 24 11:11:02 EDT 2009



Hi Vural,



1) ITK can read image from many file format.
    The MetaImage (.mha) format is not the only one.

    For a full list, just look a the directory

               Insight/Code/IO

    You will find support for the following file formats:

$ ls *ImageIO.h -1
itkAnalyzeImageIO.h
itkBMPImageIO.h
itkBioRadImageIO.h
itkBrains2MaskImageIO.h
itkDicomImageIO.h
itkGDCMImageIO.h
itkGE4ImageIO.h
itkGE5ImageIO.h
itkGEAdwImageIO.h
itkGiplImageIO.h
itkIPLCommonImageIO.h
itkJPEGImageIO.h
itkLSMImageIO.h
itkMetaImageIO.h
itkNiftiImageIO.h
itkNrrdImageIO.h
itkPNGImageIO.h
itkRawImageIO.h
itkSiemensVisionImageIO.h
itkStimulateImageIO.h*
itkTIFFImageIO.h
itkVTKImageIO.h

    You could read images from .vtk files, for example.
    Be aware, however that VTK doesn't carry orientation
    information in its file format. Something that is
    usually important for performing image registration.



2) You can get over the Casting problem, by using
    the itkCastImageFilter    :-)

http://www.itk.org/Insight/Doxygen/html/classitk_1_1CastImageFilter.html

     or... if you need to also rescale the intensity
     values, then you can do both Casting and Rescaling
     with the itkRescaleIntensityImageFilter.

     For more details,
     please read the ITK Software Guide:

        http://www.itk.org/ItkSoftwareGuide.pdf

     In particular, you should read

     Section 6.3 "Casting and Intensity Mapping"
     in pdf-pages 178-183.




3)   What "converter" do you used between ITK and VTK ?

      If you are referring to the itkVTKImport / VTKExport
      filters, then you shouldn't be too worried about
      computation time overhead, since this filters simply
      share the pixel buffer of the input image.

      If you truly want to check for performance, you could
      profile the filters by using the class

             itkTimeProbesCollectorBase

      For recommended methods on how to convert ITK to VTK
      images and back, please look at the Tutorials:

         http://www.itk.org/ITK/help/tutorials.html

      In particular to:

           "Getting Started II: Using ITK with VTK."

      http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf




    Regards,


       Luis



----------------------
Vural Özbudak wrote:
> Hi all,
> 
> I'm trying to register 3D CT images, rigid and affine transforms at 
> first. I have slice by slice DICOM data at hand. At the output of my own 
> reader, I obtain two VTK objects filled with the pixel values and the 
> header of the files. I need to connect VTK to ITK, then proceed with the 
> registration in ITK and then convert ITK to VTK again for the 
> visualization part. I encountered some problems at this stage:
> 
> 1) In the 3D rigid transform example "ImageRegistration8.cxx" it seems 
> to be that ITK takes .mha documents as an input. Does it have to be 
> ".mha"? Can we use another input type for it, if so, what kind of input 
> does ITK take? Do we need a conversion while doing this?
> 
> 2) This may seem trivial but, how could I get over the casting problem 
> from float to double, unsigned char to double and vice versa?
> 
> 3) I use a converter for the passage from VTK to ITK and ITK to VTK but 
> I'm not sure about the performance of it. Could you advise me a 
> converter that does the job for going back and forth between VTK & ITK?
> 
> 
> Thanks,
> 
> Vural
> 
> 
> ------------------------------------------------------------------------
> 
> _____________________________________
> 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 ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list