[Insight-users] Segmentation fault reading an Analyze file

Bill Lorensen bill.lorensen at gmail.com
Tue Feb 5 14:19:37 EST 2008


David,

Hans Johnson has just made some changes to nifti utilities and itk classes.
It turns out that since NIFTI appears before Analyze in the IO factory, you
are probably using the NIFTI ImageIO class (whether you want to or not). I
suggest that you update Utilities/nifti, Code/IO and testing/Code/IO. Then
try your original code again.

I looked at the Analyze code and Analyze header and it seems that Analyze
does not support anything other than unsiged char for RGB pixels. Hans can
confirm this since he is the itk Analyze/Nifti expert.

Hans, in the long term will it be possible to process all analyze files with
the nifti ImageIO class? Or at least remove most of the current
AnalyzeImageIO code, perhaps by subclassing AnalyzeImageIO from
itkNiftiImageIO?

Bill

On Mon, Feb 4, 2008 at 9:22 AM, David Lambiel <dlambielitk at gmail.com> wrote:

> Thanks for the response. Bug reported.
> David
>
>
>
> On Feb 4, 2008 2:56 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>
> > David,
> >
> > This certainly looks like a bug. I just checked the code for
> > itkAnalyzeImageIO.cxx. In ReadImageInformation there is a switch
> > statement on the data type and the code does nothing for RGB data. I'm not
> > sure why it wrote an image, it should throw an exception.
> >
> > Can you submit a bug report?
> > http://www.itk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes
> > Also, if you have a small RGB image pleased attach it to the bug report.
> >
> > Thanks,
> >
> > Bill
> >
> >
> >
> > On Mon, Feb 4, 2008 at 5:37 AM, David Lambiel <dlambielitk at gmail.com>
> > wrote:
> >
> > > Hello
> > > When reading an Analyze file (hdr+img) that I just wrote a few second
> > > before, I jump into a "segmentation fault".
> > > My image is an RGB image with an unsigned short pixel type.
> > > ITK documentation tells me that an Analyze image file :
> > >
> > > > containing usually uncompressed voxel data for the images in one of
> > > > the several possible voxel formats:
> > > >
> > > >    - 24 bit RGB, 8 bits per channel
> > > >
> > > > Ok, so I imagine that my RGB-16bits-pixel will not be accepted for
> > > the Analyze format.
> > > Question is, why does it write the RGB-16bits-pixel without problem or
> > > warning, but cannot read it ?
> > > I think it would be more logical to be able to read/write or nothing.
> > > Or perhaps I'missing something...
> > >
> > > For info, I've no problem with the same data using a raw image file
> > > (mdh+raw).
> > > I could forward some code if necessary...
> > >
> > > Thanks
> > > David Lambiel
> > >
> > > -----------------------------------------------------------------
> > > Swiss Federal Institute of Technology Lausanne (EPFL)
> > > Signal Processing Laboratory 5
> > > Station 11
> > > ELD 225 (Bâtiment ELD)
> > > 1015 Lausanne
> > > Switzerland
> > > _______________________________________________
> > > Insight-users mailing list
> > > Insight-users at itk.org
> > > http://www.itk.org/mailman/listinfo/insight-users
> > >
> > >
> >
>
>
> --
> ---------------------------------------------------------------
> Swiss Federal Institute of Technology Lausanne (EPFL)
> Signal Processing Institute (ITS)
>
> Signal Processing Laboratory 5
> Station 11
> ELD 225 (Bâtiment ELD)
> 1015 Lausanne
> Switzerland
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20080205/df4bbb06/attachment.html


More information about the Insight-users mailing list