I am trying to load the image:<br><br>InsightToolkit-3.12.0\Examples\Data\BrainProtonDensitySliceBorder20.png<br><br>into a fixedReader object:<br><br><br>...<br>...<br><br> FixedReaderType::Pointer fixedReader = FixedReaderType::New();<br>
<br> fixedReader->SetFileName(in_fixed);<br><br> try<br> {<br> fixedReader->Update();<br> }<br> catch( itk::ExceptionObject & excp )<br> {<br> std::cerr << "Exception thrown " << std::endl;<br>
std::cerr << excp << std::endl;<br> return EXIT_FAILURE;<br> }<br><br><br>But the call:<br> fixedReader->Update();<br><br>throws the exception:<br><br>Exception thrown<br><br>itk::ExceptionObject (00CAE438)<br>
Location: "void __thiscall itk::PNGImageIO::WriteSlice(const class std::basic_string<char,struct std::char_traits<c<br>har>,class std::allocator<char> > &,const void *)"<br>File: ..\..\..\Code\IO\itkPNGImageIO.cxx<br>
Line: 473<br>Description: PNG supports unsigned char and unsigned short<br><br><br>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?<br>
<br>