[Insight-users] Using MetaImageReader for reading/writing Raw files

Luis Ibanez luis.ibanez@kitware.com
Mon, 10 Mar 2003 22:13:20 -0500


Hi Neha,

The MetaImage reader expects you to provide the filename of
the header file.   For example, a combination of header and
raw data files could be:

       - brain.mhd
       - brain.raw

When you use the MetaImage you should provide as filename:

         "brain.mhd"

This header file is a small text file containing information
about the image, such as pixel spacing, numbers of pixels along
each dimension, number of channels,... and the name of the file
with the binary data.

So, having the header file, the image reader is capable of finding
the .raw file. Note that both files must be in the same directory.

The valid extensions for MetaImage are "mhd" and "mha".  You seem
to be using "mdt". ITK readers use the extension to identify the
file format.  The MetaImage reader will refuse to read a file with
extension other than "mhd" or "mha". You will have to change the
extension of you header file.



Please let us know if you have further questions,


   Thanks


      Luis


------------------------------


Neha D wrote:
> Hi All,
> 
> I am trying to use MetaImageReadWrite example. The one given in 
> Insight/Examples creates the image and reads it. I don't understand 
> where exactly does it refers the header file.
> 
> I want to read one raw file (myImage.raw ) using MetaImageReader. For 
> that, I have first created myImage.mdt using MetaImageImporter. I don't 
> get how to use read those files and write the raw file by 
> applying filter on it.
> 
> Has anyone tried on this ? Would appreciate your kind suggestions and help.
> 
> Thanks,
> 
> Neha
>