[Insight-users] Problems reading 2D analyze files

Karthik Krishnan Karthik.Krishnan at kitware.com
Fri Nov 4 14:22:01 EST 2005


Thanks for the report I ran into the same problem too and I've committed 
a fix in CVS.

Looks like there are others who ran into the same problem
http://public.kitware.com/pipermail/insight-users/2005-October/015432.html

Hans: I have a question about the code:

Lines 1208-15 of itkAnalyseImageIO.cxx

  //DEBUG--HACK It seems that analyze 7.5 requires 4 dimensions.
  this->m_hdr.dime.dim[0]= 4;
  for( dim=this->GetNumberOfDimensions();(int)dim < this->m_hdr.dime.dim[0];
       dim++ )
    {
    //NOTE: Analyze dim[0] are the number of dims, and dim[1..7] are the 
actual dims.
    this->m_hdr.dime.dim[dim+1]  = 1; //Hardcoded to be 1;
    }
 
I looked at the Analyse75.pdf document 
http://www.mayo.edu/bir/PDF/ANALYZE75.pdf and although the example 
mentions:

<snip>
  Comments:

  dim[0]: Number of dimensions in database; usually 4

  And in the code:  
    hrd.dime.dim[0] = 4; /* all Analyse images are taken as 4 dimensional */
</snip>

My interpretation is that the sample program, (which is a minimal 
example) assumes the images are 4 dimensional and this is not an 
interpretation of the header. Analyze allows images upto 7 dimensions.

ImageJ could read the analyze images fine both with the hack and without 
the hack.

Thanks
Regards
Karthik

Richard Beare wrote:

>Hi,
>I haven't tracked down the source of the problem yet, but thought I'd
>send a quick summary in case anyone recognises it.
>
>Using new versions of ITK I'm having trouble reading 2D analyze files.
>In ImageViewer (or any python scripts) I get a segmentation fault on
>reading. gdb reports the following:
>
>Program received signal SIGSEGV, Segmentation fault.
>[Switching to Thread 46912531226048 (LWP 7927)]
>0x00002aaaaacba098 in std::_Rb_tree<std::string, std::pair<std::string
>const, itk::SmartPointer<itk::MetaDataObjectBase> >,
>std::_Select1st<std::pair<std::string const,
>itk::SmartPointer<itk::MetaDataObjectBase> > >,
>std::less<std::string>, std::allocator<std::pair<std::string const,
>itk::SmartPointer<itk::MetaDataObjectBase> > > >::lower_bound ()
>   from /usr/local/lib/InsightToolkit/libITKCommon.so
>(gdb) where
>#0  0x00002aaaaacba098 in std::_Rb_tree<std::string,
>std::pair<std::string const,
>itk::SmartPointer<itk::MetaDataObjectBase> >,
>std::_Select1st<std::pair<std::string const,
>itk::SmartPointer<itk::MetaDataObjectBase> > >,
>std::less<std::string>, std::allocator<std::pair<std::string const,
>itk::SmartPointer<itk::MetaDataObjectBase> > > >::lower_bound ()
>   from /usr/local/lib/InsightToolkit/libITKCommon.so
>#1  0x00002aaaaacb9b57 in itk::MetaDataDictionary::operator[] ()
>   from /usr/local/lib/InsightToolkit/libITKCommon.so
>#2  0x00002aaaaaf7ccf0 in itk::AnalyzeImageIO::ReadImageInformation ()
>   from /usr/local/lib/InsightToolkit/libITKIO.so
>#3  0x000000000043a190 in itk::ImageFileReader<itk::Image<float, 3u>,
>itk::DefaultConvertPixelTraits<float> >::GenerateOutputInformation ()
>#4  0x00002aaaaac67d11 in itk::ProcessObject::UpdateOutputInformation ()
>   from /usr/local/lib/InsightToolkit/libITKCommon.so
>#5  0x000000000042cda0 in itk::ImageBase<3u>::UpdateOutputInformation ()
>#6  0x00002aaaaac2c9ad in itk::DataObject::Update ()
>   from /usr/local/lib/InsightToolkit/libITKCommon.so
>#7  0x00000000004229eb in main ()
>
>
>I am able to load the same image successfully using a much older
>version of itk and ImageViewer compiled from cvs back at the end of
>September.
>
>The current version seems to read 3D images without any problems.
>
>Any ideas?
>_______________________________________________
>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