[Insight-users] Dimensionality of Analyze Images

matthias.honal at uniklinik-freiburg.de matthias.honal at uniklinik-freiburg.de
Mon Jul 30 04:12:24 EDT 2007


Hi Luis,

as you suggested, I put the call to Update() of the image file reader in a
try/catch block (exactly as it is done in many ITK examples), however no
exception was thrown. Instead I receive the following error:

*** glibc detected *** ImageReadWrite3D: malloc(): memory corruption:
0x08103d60 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb6cac1cd]
/lib/tls/i686/cmov/libc.so.6(malloc+0x7f)[0xb6cad83f]
/usr/lib/libstdc++.so.6(_Znwj+0x27)[0xb6e364b7]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep9_S_createEjjRKSaIcE+0x6b)[0xb6e1187b]
/usr/lib/libstdc++.so.6[0xb6e12a65]
/usr/lib/libstdc++.so.6(_ZNSsC1EPKcRKSaIcE+0x47)[0xb6e12c17]
/home/honal/mds/itk/itk_debug_3.2.0/bin/libITKIO.so.3.2
(_ZN3itk19EncapsulateMetaDataISsEEvRNS_18MetaDataDictionaryEPKcRKT_+0x37)[0xb7dfa963]
/home/honal/mds/itk/itk_debug_3.2.0/bin/libITKIO.so.3.2
(_ZN3itk12NiftiImageIO20ReadImageInformationEv+0x18eb)[0xb7df3817]
ImageReadWrite3D(_ZN3itk15ImageFileReaderINS_5ImageIfLj2EEENS_25DefaultConvertPixelTraitsIfEEE25GenerateOutputInformationEv+0x795)[0x80716cf]
/home/honal/mds/itk/itk_debug_3.2.0/bin/libITKCommon.so.3.2
(_ZN3itk13ProcessObject23UpdateOutputInformationEv+0x1a5)[0xb79ed57b]
ImageReadWrite3D(_ZN3itk9ImageBaseILj2EE23UpdateOutputInformationEv+0x8a)[0x807565c]
/home/honal/mds/itk/itk_debug_3.2.0/bin/libITKCommon.so.3.2
(_ZN3itk10DataObject6UpdateEv+0x18)[0xb79ab87c]
/home/honal/mds/itk/itk_debug_3.2.0/bin/libITKCommon.so.3.2
(_ZN3itk13ProcessObject6UpdateEv+0x4f)[0xb79ec4d3]
ImageReadWrite3D(main+0x130)[0x805d932]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc)[0xb6c5a8cc]
ImageReadWrite3D(_ZN3itk13ProcessObject24PropagateRequestedRegionEPNS_10DataObjectE+0xc1)[0x805d6d1]

(Note that although my program is called ImageReadWrite3D, I took care to
set the dimension of the Image type which I pass as template argument to
the reader to 2.)

>From the above backtrace and from a little bit of debugging, I found out,
that the error occurs somewhere in itkNifitImageIO.txx (line 771) upon the
call of EncapsulateMetaData:
------------------
//Important hist fields
  std::string description(this->m_NiftiImage->descrip);
  EncapsulateMetaData<std::string>(this->GetMetaDataDictionary(),
                                    ITK_FileNotes,description);
-------------------

So before I continue the debugging step by step, perhaps someone has a
quick idea what might go wrong here and what might have changed from ITK
2.8.1 to 3.2.0 that the same code which worked before crashes now.

Thanks a lot,
Matthias





                                                                           
             Luis Ibanez                                                   
             <luis.ibanez at kitw                                             
             are.com>                                                   An 
                                        matthias.honal at uniklinik-freiburg. 
             29.07.2007 19:49           de                                 
                                                                     Kopie 
                                        insight-users at itk.org              
                                                                     Thema 
                                        Re: [Insight-users] Dimensionality 
                                        of Analyze Images                  
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi Matthias,

Are you sure that you got a segmentation fault
and not an Exception ?

Are you using a try/catch block around the call to Update() ?

It is very likely that you are getting and exception,
in which case, the exception is carrying a message
describing the nature of the error.

You will find many examples on how to use try/catch
blocks in the ITK Software Guide:


       http://www.itk.org/ItkSoftwareGuide.pdf


If you catch an exception you can print out its
description.




   Please let us know what you find.


     Thanks


        Luis


------------------------------------------
matthias.honal at uniklinik-freiburg.de wrote:
> Hi,
>
> I recently found out that in ITK 3.2.0 the reading of two dimensional
> Analyze images produces segmentation faults, while this worked well with
> ITK 2.8.1 with the same code (e.g. the ImageReadWrite from the ITK
examples
> in the simplest case).  Since I'm not an expert in medical file formats,
I
> would like to know whether this behavior of ITK 3.2.0 is expected (since
> Analyze images have to have at least 3 dimensions) or whether it should
be
> possible to read 2D Analyze  images as well. In the latter case there may
> be problems with my images which I'll have to find out...
>
>
> Thanks a lot,
> Matthias
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>




More information about the Insight-users mailing list