[Insight-developers] MetaIO Unknown meta-data bug

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Aug 15 10:46:26 EDT 2012


Hello,

I have a fix here for a bug I have encountered with the MetaImageIO:

http://review.source.kitware.com/#/c/6998/


The question I have to the MetaImage folk, is if this is just a problem with the ITK ImageIO or does a fix in the MetaIO library need to be made. I took the path of least resistance and just fixed it in ITK's ImageIO. However, the fact that passing an empty string to the "AddUserField" method results in a meta image header file which can not be read back is concerning. I unfortunately I don't really care to dive into the metaio library unless needed.

The error from the test I wrote:

WARNING: In /nfs/Users/blowekamp/src/ITK-gerrit/Modules/IO/Meta/src/itkMetaImageIO.cxx, line 633
MetaImageIO (0x102005400): Unsupported metaData item AnUnsuportedComplexInitalized of type St7complexIfEfound, won't be written to image file

DimSize required and not defined.
MetaObject: Read: MET_Read Failed
MetaImage: M_Read: Error parsing file
MetaImage: Read: Cannot parse file
ITK test driver caught an ITK exception:

itk::ExceptionObject (0x100e00790)
Location: "unknown" 
File: /nfs/Users/blowekamp/src/ITK-gerrit/Modules/IO/Meta/src/itkMetaImageIO.cxx
Line: 87
Description: itk::ERROR: MetaImageIO(0x102006800): File cannot be read: foo.mha for reading.
Reason: Unknown error: 0

The file header:

ObjectType = Image
NDims = 2
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
TransformMatrix = 1 0 0 1
Offset = 0 0
CenterOfRotation = 0 0
ElementSpacing = 1 1
ASimpleFloatInitalized = 1.23456
AnUnsuportedComplexInitalized = 
DimSize = 32 32
AnatomicalOrientation = ??
ElementType = MET_USHORT
ElementDataFile = LOCAL

Thanks for feedback,
Brad

========================================================
Bradley Lowekamp  
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120815/4e540f9f/attachment.htm>


More information about the Insight-developers mailing list