[Insight-users] Problem : Meta Image Element Types : 4D image

Luis Ibanez luis . ibanez at kitware . com
Thu, 20 Nov 2003 13:35:20 -0500


Hi Neha,

You are creating a 4D image.

That's fine as long as you provide all the
necessary entries.

For the dimensions and pixel spacing you
seem to be doing the right thing. However
for Position you are only providing two
values, they must be four, since these are
the coordinates of the origin in a 4D space.

This may easily be breaking the rest of the
parsing.

An easy way to get the right format for the
MetaImage header is to run the application


          MetaImageImporter

available in


   InsightApplications/MetaImageImporter



Regards,



   Luis


-------------------
Neha D wrote:
> hi all,
> 
> i am trying to read stimulate file, by using metaImage header. (since i 
> have already program using metaImage format)
> 
> For this, i create .mhd file.  Original .spr file (header file for 
> stimulate format) and my .mhd file are as follows:
> 
> *_.spr file_*
> 
> numDim: 4
> 
> dim: 256 256 24 1
> 
> interval: 0.625000 0.625000 3.000000 1.0
> 
> dataType: WORD
> 
> sdtOrient: ax
> 
> endian: ieee-be
> 
> *_.mhd file_*
> 
> NDims = 4
> 
> DimSize = 256 256 24 1
> 
> ElementSpacing = 0.625000 0.625000 3.000000 1.0
> 
> Position = 0 0
> 
> ElementByteOrderMSB = True
> 
> ElementType = MET_SHORT  ( i tried wtih MET_USHORT as well since i am 
> not sure
> 
> if WORD is MET_USHORT or MET_SHORT )
> 
> HeaderSize = -1
> 
> ElementDataFile = shilpa_magI_001.raw
> 
> *_when i try to read raw file using above header file, i get following 
> error message_*
> 
> ElementType required and not defined.
> MetaObject: Read: MET_Read Failed
> MetaImage: M_Read: Error parsing file
> MetaImage: Read: Cannot parse file
> Exception caught during Raw file reading
> 
> itk::ExceptionObject (00F1F520)
> Location: "Unknown"
> File: C:\Insight1.2\Code\IO\itkImageIOBase.cxx
> Line: 122
> Description: itk::ERROR: MetaImageIO(00228ED0): Unknown pixel type: 0
> 
> I am not able to find out what exactly is wrong.  I think I am 
> specifying MET_USHORT in incorrect way.  Any input on this is appreciated.
> 
> Thanks,
> 
> Neha
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard 
> <http://antispam . yahoo . com/whatsnewfree>