[Insight-users] Bug in itkPNGImageIO

Koen Van Leemput koen . vanleemput at hus . fi
Mon, 15 Jul 2002 14:28:51 +0300


When writing a 3-D image with itkPNGImageIO, all the files "%s%d.png" con=
tain=20
the same first slice of the data set. This appears to be causes by=20

PNGImageIO::WriteSlice(std::string& fileName, const void* buffer,
                            unsigned long offset)

in which the "offset" argument is not correctly handled.

To replicate this error, use something like

typedef  itk::ImageFileWriter< ImageType >      FileSinkType;
typedef  itk::PNGImageIO                              PNGWriterType;

FileSinkType::Pointer      fileSink   =3D FileSinkType::New();
PNGWriterType::Pointer   PNGWriter  =3D PNGWriterType::New();

fileSink->SetImageIO( PNGWriter );
fileSink->SetFilePrefix( outputFilePrefix );
fileSink->SetInput( fileSource->GetOutput() );
fileSink->Write();
=20
This should be easy to fix...

Koen


--=20
*************************************************************************=
****=20
Koen Van Leemput, Ph.D.                email : koen.vanleemput@hus.fi=20
Department of Radiology                  phone: +358 9 471 71331       =20
Helsinki University Central Hospital   mobile: +358 9 471 62300       =20
P.O. Box 340                                  fax:      +358 9 471 71342 =
      =20
FIN-00029 HUS                                                            =
              =20
FINLAND                                                                  =
                 =20
*************************************************************************=
****=20