Hi,

First - thanks!!!!   It is great to catch these lingering errors.

Second - The ITK version of MetaIO is locked, and so it should not be
possible for you to commit changes to it.   It is automatically
updated by a robot whenever the main repo is changed.  The main repo
is shared by ITK and VTK.

Third - it is a bug we should fix.   My preference is to simply not
write out a tag if there is no associated value.   Agreed?    Then, if
a tag without a value is found, should it report an error, or just
continue on?   I guess continue on, but not report that tag as set.
Agreed?

Thanks,
Stephen

On Wed, Aug 15, 2012 at 10:46 AM, Bradley Lowekamp
<[email protected]> wrote:
> 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
>
> [email protected]
>
>
>
>



-- 

==============================
Stephen R. Aylward, Ph.D.
Senior Director of Operations - North Carolina
Kitware, Inc. - North Carolina Office
http://www.kitware.com
stephen.aylward (Skype)
(919) 969-6990 x300
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

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-developers

Reply via email to