[Insight-users] Errors with Insight Applications on the Mac

Luis Ibanez luis.ibanez@kitware.com
Sun, 16 Mar 2003 11:18:37 -0500


Hi Robb,

ITK doesn't have any reader for TIFF format,
so this certainly not work.

The support for reading VTK structured points should
be working ok for both binary and ascii. Here is below
a tipical VTK header for structured points. This is from
one image writen with itkVTKImageIO. This image can be
read without problem.

> # vtk DataFile Version 3.0
> VTK File Generated by Insight Segmentation and Registration Toolkit (ITK)
> BINARY
> DATASET STRUCTURED_POINTS
> DIMENSIONS 181 217 180
> SPACING 1 1 1
> ORIGIN 0 0 0
> POINT_DATA 7069860
> SCALARS scalars unsigned_char 1
> LOOKUP_TABLE default

Could you please post the header section of one of the VTK
files you are having trouble reading ?
That could help us to reproduce the problem.


Same thing goes for the Analyze file. If you could provide
us with a minimal example of a file that is not being read,
that will facililtate to track the problem.

It may be another particularity of the Mac....
or it may be a real bug, or a characteristic of the image
files you are using...

Endianness is certainly one of the things that is worth
to verify. (however, when endianness is the problem,
usually the reader succed feeding the data into memory,
but the data looks like noise...).

Having some images will help us to reduce the set
of suspects.

The AntiAliasBinaryImageFilter  example is explicitly
using the RawImageIO. We are discouraging this practice now
that many image file formats have been added to the toolkit.
We will probably refactor this demo-application.


Thanks


    Luis


--------------------
Robb Brown wrote:
 >
 > Thanks for the quick fix with the RAW reader.  It works correctly now.
 >
 > The GradientMagnitude filter is my fault -- the only file format I
 > could get the application to load was DICOM so I was giving it a 2D
 > DICOM slice.  It works correctly when given 3D data.
 >
 > Problem is, the reader doesn't seem to want to read most file formats
 > on the Mac.  I tried VTK structured points files, both binary and
 > ASCII, a TIF file, and an Analyze file, none of which worked.
 > Metaimage files and DICOM I could read.  I modified
 > GeodesicActiveContour to provide a more useful error message (printing
 > the exception rather than just saying error).  The errors occurred in
 > various places, sometimes while detecting the file type and sometimes
 > in the specific file reader itself.  I've included a couple of the
 > exception printouts below.
 >
 > I also noticed that AntiAliasBinaryImageFilterExample writes its output
 > in little-endian format, even though it's running on a big-endian mac.
 > Maybe endianism has something to do with the other errors as well?
 >
 > VTK Structured Points:
 > itk::ERROR: VTKImageIO(0x1229c50): Unrecognized
 > type/private/Network/Servers/mrc-filer.crha-health.ab.ca/vol/data/
 > common/development/unstable/Insight-1.2/Code/IO/itkVTKImageIO.cxx318
 >
 > TIF File:
 > File cannot be
 > read/private/Network/Servers/mrc-filer.crha-health.ab.ca/vol/data/
 > common/development/unstable/Insight-1.2/Code/IO/ 
itkAnalyzeImageIO.cxx1002
 >
 > Analyze File:
 > Unexpected end of
 > file/private/Network/Servers/mrc-filer.crha-health.ab.ca/vol/data/
 > common/development/unstable/Insight-1.2/Code/IO/ 
itkAnalyzeImageIO.cxx1009
 >
 >
 >
 > On Wednesday, March 12, 2003, at 08:17 PM, Luis Ibanez wrote:
 >
 >>
 >> Hi Robb,
 >>
 >> Thanks for reporting these two failures.
 >>
 >> 1) The Raw reader problem was identified
 >>    recently. It is due to a broken implementation
 >>    of the fstream.fail() function in the Mac.
 >>
 >>    It happens that fail() returns true in the Mac
 >>    when you reach the end of the file.  We fixed
 >>    this in the trunk but visibly not in the 1.2 branch.
 >>
 >>    I just cheked in the fix in the 1.2 release branch.
 >>
 >>    You may get the modified file through the
 >>    CVS web server:
 >>
 >> http://www.itk.org/cgi-bin/cvsweb.cgi/Insight/Code/IO/
 >> itkRawImageIO.txx?cvsroot=Insight&only_with_tag=Release-1-2
 >>
 >>    Note that the branches are selected at the bottom
 >>    of the page.
 >>
 >>
 >> 2) The second problem, related to the GradientMagnitude
 >>    seems to be new.
 >>
 >>    It looks like it is specific to the Mac. Our other
 >>    builds on the release 1.2 are not showing this.
 >>
 >>    Is this crashing in the program in Insight/Examples ?
 >>    or in the GUI application in InsightApplications/
 >>    GeodesicActiveContours ?
 >>
 >>    Could you please give us more details on this.
 >>    It is possible that the source of the error is a
 >>    badly read image file, or a too small volume. What
 >>    data are you providing to the program.
 >>
 >>    This filter requires at least 5 pixels along every
 >>    dimension.
 >>
 >>
 >> Please let us know,
 >>
 >>
 >>
 >> Thanks
 >>
 >>
 >>
 >>   Luis
 >>
 >>
 >>
 >> -----------------------
 >>
 >>
 >> Robb Brown wrote:
 >>
 >>> I've gotten two errors when running examples from the Insight
 >>> Applications 1.2.0, using ITK 1.2.0 and VTK 4.2.
 >>> The first is a problem with the raw file reader in the
 >>> AntiAliasBinaryImageFilterExample program.  Using data generated by
 >>> the included utility, the program reports:
 >>> itk::ExceptionObject (0x2cd260)
 >>> Location: "Unknown"
 >>> File: /usr/local/include/InsightToolkit/IO/itkRawImageIO.txx
 >>> Line: 190
 >>> Description: itk::ERROR: RawImageIO(0x2c8bf0): Read failed: Wanted
 >>> 262144 bytes, but read 262144 bytes.
 >>> Note that the expected file size and the read file size ARE the same.
 >>> The second problem involves the Gradient Magnitude filter used in
 >>> several of the segmentation applications (GeodesicActiveContour is
 >>> one).  It crashes when run with a bus error.  The crash log reports:
 >>> Date/Time:  2003-03-10 14:30:33 -0700
 >>> OS Version: 10.2.4 (Build 6I32)
 >>> Host:       mrc-brownr.crha-health.ab.ca
 >>> Command:    GeodesicActiveContour
 >>> PID:        1115
 >>> Exception:  EXC_BAD_ACCESS (0x0001)
 >>> Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00553ff8
 >>> Thread 0 Crashed:
 >>>  #0   0x00126070 in
 >>> itk::RecursiveSeparableImageFilter<itk::Image<float, (unsigned)3>,
 >>> itk::Image<float, (unsigned)3> >::FilterDataArray(double*, double
 >>> const*, unsigned)
 >>>  #1   0x00108cac in
 >>> itk::RecursiveSeparableImageFilter<itk::Image<float, (unsigned)3>,
 >>> itk::Image<float, (unsigned)3> >::GenerateData()
 >>>  #2   0x0001ef18 in
 >>> itk::ProcessObject::UpdateOutputData(itk::DataObject*)
 >>>  #3   0x0001951c in itk::DataObject::UpdateOutputData()
 >>>  #4   0x0001eb74 in
 >>> itk::ProcessObject::UpdateOutputData(itk::DataObject*)
 >>>  #5   0x0001951c in itk::DataObject::UpdateOutputData()
 >>>  #6   0x0001909c in itk::DataObject::Update()
 >>>  #7   0x0001e260 in itk::ProcessObject::Update()
 >>>  #8   0x00105db0 in
 >>> itk::GradientMagnitudeRecursiveGaussianImageFilter<itk::Image<float,
 >>> (unsigned)3>, itk::Image<float, (unsigned)3> >::GenerateData()
 >>>  #9   0x0001ef18 in
 >>> itk::ProcessObject::UpdateOutputData(itk::DataObject*)
 >>>  #10  0x0001951c in itk::DataObject::UpdateOutputData()
 >>> etc.
 >>> Are these problems just on the Mac?  Thanks for any help,
 >>> Robb
 >>> _____________________________
 >>> Robb Brown
 >>> Seaman Family MR Center
 >>> Calgary, AB
 >>> _______________________________________________
 >>> Insight-users mailing list
 >>> Insight-users@public.kitware.com
 >>> http://public.kitware.com/mailman/listinfo/insight-users
 >>
 >>
 >>
 >>
 >>
 >>
 > _____________________________
 > Robb Brown
 > Seaman Family MR Center
 > Calgary, AB
 >
 >