[Insight-users] Problems with fixedReader->Update();

motes motes mort.motes at gmail.com
Tue Jul 21 15:43:14 EDT 2009


I am trying to load the image:

InsightToolkit-3.12.0\Examples\Data\BrainProtonDensitySliceBorder20.png

into a fixedReader object:


...
...

  FixedReaderType::Pointer fixedReader = FixedReaderType::New();

    fixedReader->SetFileName(in_fixed);

    try
    {
      fixedReader->Update();
    }
    catch( itk::ExceptionObject & excp )
    {
      std::cerr << "Exception thrown " << std::endl;
      std::cerr << excp << std::endl;
      return EXIT_FAILURE;
    }


But the call:
      fixedReader->Update();

throws the exception:

Exception thrown

itk::ExceptionObject (00CAE438)
Location: "void __thiscall itk::PNGImageIO::WriteSlice(const class
std::basic_string<char,struct std::char_traits<c
har>,class std::allocator<char> > &,const void *)"
File: ..\..\..\Code\IO\itkPNGImageIO.cxx
Line: 473
Description: PNG supports unsigned char and unsigned short


I have tried removing the update() call but then I get an error further down
the code. It seems that the error is related to the PNG format of the file,
any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090721/db445a30/attachment.htm>


More information about the Insight-users mailing list