[Insight-users] Possible bug in itkAnalyzeImageIO?
Raghavendra Chandrashekara
rc3@doc.ic.ac.uk
Fri, 28 Mar 2003 10:46:12 -0000
Hi Kent,
Okay I tried the patch that you sent. Now another exception is thrown, this
time by the itkImageFileReader class:
Exception object caught!
itk::ImageFileReaderException (0x815ace8)
Location: "Unknown"
File: /vol/vipdata/packages/InsightCVS/Code/IO/itkImageFileReader.txx
Line: 94
Description: Could not create IO object for file
../../Data/Synthetic/cube.gipl
Does this mean that the gipl image is not being recognised by any of the IO
classes?
Raghavendra.
----- Original Message -----
From: "Kent Williams" <kent@mail.psychiatry.uiowa.edu>
To: "Raghavendra Chandrashekara" <rc3@doc.ic.ac.uk>
Sent: Wednesday, March 19, 2003 6:46 PM
Subject: Re: [Insight-users] Possible bug in itkAnalyzeImageIO?
I don't know why you're getting that far into CanRead, since the 1.2 version
of itkAnalyzeImageIO.cxx checks for valid extensions first before trying to
open the file.
I think that it's incorrect to throw an exception in CanRead anyway; my
suggestion to you is to patch around line 1000 in that file thusly:
CHANGE:
if( local_InputStream.fail() )
{
ExceptionObject exception(__FILE__, __LINE__);
exception.SetDescription("File cannot be read");
throw exception;
}
local_InputStream.read( (char *)&(this->m_hdr), sizeof(struct dsr) );
if( local_InputStream.eof() )
{
ExceptionObject exception(__FILE__, __LINE__);
exception.SetDescription("Unexpected end of file");
throw exception;
}
TO:
if( local_InputStream.fail() )
{
return false;
}
local_InputStream.read( (char *)&(this->m_hdr), sizeof(struct dsr) );
if( local_InputStream.eof() )
{
return false;
}