[Insight-developers] GDCMImageIO crashes in CanReadFile! (ITK-2857)

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Mar 16 09:51:49 EDT 2012


Hi,

On Thu, Mar 15, 2012 at 8:51 PM, Williams, Norman K
<norman-k-williams at uiowa.edu> wrote:
> I'm trying to clear some of my longstanding ITK Jira tickets and started
> looking at this:
>
> https://itk.icts.uiowa.edu/jira/browse/ITK-2857
>
> I verified that this is in fact a real problem.  Furthermore the problem
> is this: GDCMImageIO::CanReadFile tries to read the file with the GDCM
> library, and the reader gets way too far into reading the file before an
> assertion fails and it crashes.
>
> In other words GDCM Library Seen As Harmful.

For some reason I got CCed on that message. So I am jumping in this
bug report, but I am having a very very hard time to understand how
GDCM could be related to a report which claims:

...
DimSize required and not defined.
MetaObject: Read: MET_Read Failed
MetaImage: M_Read: Error parsing file
MetaImage: Read: Cannot parse file
terminate called after throwing an instance of 'itk::ExceptionObject'
what(): /home/vdelmon/work/ITK/Modules/IO/Meta/src/itkMetaImageIO.cxx:87:
itk::ERROR: MetaImageIO(0x27314f0): File cannot be read: tata.mhd for reading.
Reason: Success
zsh: abort ./analyze_test tata.mhd titi.mhd
...

> I'm going to try and find a way to sniff a DICOM file that doesn¹t involve
> making the GDCM library cause assertion failures, but if anyone already
> knows how to do this don't hesitate to speak up!

I would suggest you give GDCM another try. The function CanRead took
some iterations to work, see for yourself:

http://gdcm.git.sourceforge.net/git/gitweb.cgi?p=gdcm/gdcm;a=commitdiff;h=d9da82f5;hp=d868c525d3214c38a1ec99581e205daf40387c1d#patch4

A well known-code (D. Clunie) is referenced in the source code and I
explain why this online reference does not work with real-life DICOM
instances.

2cts
-- 
Mathieu


More information about the Insight-developers mailing list