[Insight-users] Error reading a simple image with IT4 and QT

Françoise LEFEBVRE lefebvre at imnc.in2p3.fr
Mon Mar 19 09:48:15 EDT 2012


Hi,

I recently installed msvc 2010, IT4.1 and QT4.8 on windows 7.

  When trying to read a simple image ( .bmp or .jpg or .png ), I get the 
following exception :
Could not create IO object for file image.bmp
   Tried to create one of the following:
   You probably failed to set a file suffix, or  set the suffix to an 
unsupported type.

The source code is very simple :
    typedef short      PixelType;
   const   unsigned int        Dimension = 2;
   typedef itk::Image< PixelType, Dimension >    ImageType;
   typedef itk::ImageFileReader< ImageType >  ReaderType;
   ReaderType::Pointer reader = ReaderType::New();
   reader->SetFileName( "image.bmp");
    try
     {
     reader->Update();
     }

It seems that in a cmake project, the variable ITK_USE_FILE must be 
added but I am using a QT .pro configuration file.

Do you have any idea ?

Two more information :
- Everything works fine when reading a raw format using my own class 
derived from itk::ImageIOBase()
- I previously used ITK3, Qt2.6, msvc2008 on windows xp, everything 
worked fine.

Thank you for your help.

Best regards,

F. Lefebvre



More information about the Insight-users mailing list