[Insight-users] MetaImageIO

Luis Ibanez luis.ibanez at kitware.com
Wed Dec 21 21:07:21 EST 2005


Hi Kalpathi,


It seems that you are missusing the itk::MetaImageIO class.


Please read the ITK Software Guide:

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

In particular Chapter 7, "Reading and Writing Images"
in pdf-pages 295-347.


There are *MANY* examples on how to read and write images
in the software guide.


You shouldn't have to deal with the MetaImageIO class at all.
Simply use the ImageFileReader and the ImageFileWriter and
the underlying ImageIO factory mechanism will take care of
finding the appropriate reader/writer for your file format.


Just take the code from


     Insight/Examples/IO/
              ImageReadWriter.cxx


by only changing the pixel type and the dimension, this
file should be able to read your MetaImage and write it
in any of the supported file formats.



   Regards


     Luis



-----------------------------
Kalpathi Subramanian wrote:
> I am trying to read a raw image with a .mhd file containing
> its header using the MetaImageIO class..
> 
> But when compiling, it doesnt even seem to find this template class.
> Isnt it supposed to be part of the libITKIO.so library? (nm shows
> the symbols for it). There is also a libMetaIO.so. Including
> this doesnt seem to make any difference, either..
> 
> The exact error from compilation..
> 
> itk::MetaImageIO is not a template
> 
> 
> Also, I am a little unclear as to using this reader. I have a .mhd
> file and a corresponding image file in raw format. Do I need
> to explicitly create the MetaImageIO class and then call 
> ReadImageInformation() or something?  Its just not clear to me
> how the header is read in. Are  there any examples I can look at.
> I dont think there is one in teh software guide.
> 
> Thanks.
> 
>     == krs
> 
> 
> 
> 
> •••••••••••••••••••••••••••
> K.R.Subramanian                        Phone: (704) 687-8579
> Department of Computer Science         FAX:   (704) 687-3516
> UNC Charlotte, STech 435E              Email: krs at uncc.edu
> Charlotte, NC 28223-0001               Web: http://www.cs.uncc.edu/~krs
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 



More information about the Insight-users mailing list