[Insight-users] metaIO in ITK

Andreas Schuh andreas.schuh.84 at googlemail.com
Wed Mar 18 17:46:39 EDT 2009


Hi Wen,

have a look at the meta data files in the Examples/Data directory. You 
can open the *.mhd file with any text editor. It contains the image 
information of your raw data like the number of dimensions, the number 
of pixels for each dimension, the spacing, the pixel type ... moreover, 
it contains the name of the *.raw file that contains the pixel data 
only. The *.raw file alone isn't enough. In this case you would have to 
specify all these image information in your code.
So, the mhd file is the starting point as it contains the important meta 
data of the image and refers to the raw file that contains the raw pixel 
data. It is the mhd filename that has to be set as filename of the 
itk::ImageFileReader to read a Meta image.

--
regards
Andreas

Wen Shi schrieb:
> Hi Guys,
>
> I am confused by converting RAW image to Meta images.
>
> When I was reading the software guide, it argues that:
> "The direct use of raw file is strongly discouraged in medical imaging. It is always better to create
> a header for a raw file by using any of the file formats that combine a text header file and a raw
> binary file, like itk::MetaImageIO"
>
> Then I refer to the documentation of MataImage, then I found a example:
>
> /** We create a simple 3D metaObject with some properties */
>  MetaObject tObj(3); // Create a 3D metaObject
>  tObj.FileName("testObject.txt"); // Define the name of the file
>  tObj.Comment("TestObject"); // Add some comments
>  tObj.ObjectTypeName("Object"); // Define the type of the object
>  tObj.ObjectSubTypeName("MinorObject"); // and the subtype as well
> ........................................
> ...........................................
>
>
> I am kind of confused. in the guide it says we need to create a "header file"
> What's the "header file"? is it some code header file similar to the above example ?
> If you want to read in a RAW image, you write such a header file and include it to the program project?
> (Like modify the "tObj.FileName("testObject.txt")" to be "tObj.FileName("testObject.raw")")?
>
> Besides there is a .mhd file accompany the .raw file. How to deal with this pair of files?
>
> Thanks a lot 
>
> Wen Shi
> _____________________________________
> 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