[Insight-users] IO object creation error

Ralf o Floca rfloca at stud . fh-heilbronn . de
Fri, 26 Sep 2003 23:13:18 +0200


Hi Rg32 and Luis,

I just got the same exception today, 4 hours before. (Could not create IO
object for file... ; in line 101 of itkImageFileReader.txx)

In my case there was nothing wrong with the png file (it worked many times
before).
The reason for the exception was, that the ImageFileReader didn't found a
capable ImageIO.
The ImageIO for png files didn't accepted my file, because the file was
specified in uppercase and the png ImageIO checks for "png" and don't
recognizes "FILE.PNG". After converting the path string to lowercase, all
worked perfect.

Maybe it is the same error in your case and it will help you (hope so). In
your explanation the file was writen in lowercase, but may be it was only
habit when writing the mail. If not, at least, it can be considered, if it
is the right behavior for the ImageIO. I think it would be better if the
string would be converted automatically before checking the existance of
"png".

Regards,

Ralf o Floca

> luis . ibanez at kitware . com wrote:
>
> Hi Rg32,
>
> Your code looks fine.
>
> The ImageFileReader throws exceptions when it
> fails to find an ImageIO capable of reading
> your image file.
>
> It may be that your "bar1.png" file is not
> quite a standard PNG file.
>
> Have you tried with the PNG files that are
> available in Insight/Examples/Data  ?
>
> Please try your program with the PNG files
> in that directory.
>
> You could also try to read your PNG file
> with some of the IO examples in
> Insight/Examples/IO,
>
> a good try will be ImageReadWrite.cxx
>
>
> This should help to figure out if the
> problem is originated from your code or
> from your data.
>
>
> Please let us know what you find.
>
>
> Thanks,
>
>
>    Luis