[Insight-users] Re: Read .raw MR image file and convert to vtk

Vladimir FONOV vladimir.fonov at gmail.com
Tue May 30 12:10:17 EDT 2006


Hello,

Mafalda Sousa wrote:

> I would like to know if it's possible to read .raw image files with ITK.
> I've tried with RawImageIO and it didn't work.
> Instead of .raw files I also have MINC files. This files are Simulated 
> Brain
> MR Images obtained from Brainweb http://www.bic.mni.mcgill.ca/brainweb/ .
> I usually use real Dicom files and transform them to VTK files, but this
> simulated data sets would be very usefull if i could use them. I just don't
> know how to read them.
> 

You can try to use MetaImageIO, you can construct an .mhd file , and 
then read it in usual way ( using itk::ImageFileReader )
There is an application MetaImageImporter in  InsightApplications, that 
will create and .mhd file for you.
In short, mhd file is a text file of the following format:

NDims = <number of dimensions>
DimSize = <x size> <y size> <z size>
ElementSpacing = <x spacing> <y spacing> <z spacing>
Position = <x origin> <y origin> <z origin>
ElementByteOrderMSB = <False if the data in PC byte order>
ElementNumberOfChannels =  <number of channels per voxel>
ElementType = <data type: MET_UCHAR, MET_USHORT, MET_UINT MET_FLOAT 
MET_DOUBLE>
ElementDataFile = <name of the RAW file>

--
Best regards,
Vladimir S. Fonov ~ www.bic.mni.mcgill.ca/~vfonov



More information about the Insight-users mailing list