[Insight-users] Compiling ITK on Windows: GIPL - Analyze problem

Luis Ibanez luis.ibanez@kitware.com
Thu, 06 Mar 2003 10:22:29 -0500


Hi Kent,

Yeap, the

         bool CanReadFile()

should just retun "false" if it cannot read the file.

In this way it will pass the token to the next IO
factory in queue and give it an opportunity to read
the file.

CanReadFile() is just an attempt to read the file
with the slack that the file may not be intended
for this specific reader. A filename is passed in
sequence to all the registered readers. CanReadFile()
is a mechanism for finding which one of the readers
claims to be capable of reading this format.


In the ReadFile() method, on the other hand, you
can throw exceptions since at this point it has
already been decided that the file is really intended
for this particular reader.


Please remove the exception from CanReadFile() and
just return "false".



Thanks a lot,


Luis


-----------------------

Kent Williams wrote:
> I wrote the code in itk::AnalyzeImageIO::CanReadFile()
> 
> If you look in the source, this method only tries to open the file if it has a 
> filename extension of "hdr" or "img".  Or so I thought; I will try and step 
> throught this and see what happens if another extension is given.
> 
> If the method gets past that test, and fails to open the file, then the 
> existing cod throws an exception -- should it instead simply return false, 
> indicating that it cannot read the file?
> 
> On Thursday 06 March 2003 08:21 am, Luis Ibanez wrote:
> 
>>Hi Raghavendra,
>>
>>Thanks for the feedback, it seems that we
>>have a problem with the Analyze reader then.
>>
>>We are tracking this down.
>>
>>Thanks
>>
>>
>>Luis
>>
>>
>>----------------------------------
>>
>>Raghavendra Chandrashekara wrote:
>> > I am using the right extension (.gipl). I tried using the ramp.gipl
>>
>>image in
>>
>> > the Testing/Data/Input directory but my program crashed. I think the
>>
>>image
>>
>> > may be corrupted. When I used a different image it was read and written
>> > properly.
>> >
>> >>If the extensions happen to be correct, this may
>> >>indicate a problem with the Analyze image reader,
>> >>in which case we will track it down.
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users@public.kitware.com
>>http://public.kitware.com/mailman/listinfo/insight-users
> 
> 
>