[Fwd: [Insight-users] Bug in itkPNGImageIO]

Luis Ibanez luis . ibanez at kitware . com
Mon, 15 Jul 2002 08:56:11 -0400


This is a multi-part message in MIME format.
--------------020003080101060406020308
Content-Type: message/rfc822;
 name="Re: [Insight-users] Bug in itkPNGImageIO"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Re: [Insight-users] Bug in itkPNGImageIO"

>From - Mon Jul 15 08:47:51 2002
X-Mozilla-Status2: 00000000
Message-ID: <3D32C3C6.2090504@kitware.com>
Date: Mon, 15 Jul 2002 08:44:54 -0400
From: Luis Ibanez <luis.ibanez@kitware.com>
Organization: Kitware Inc.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901
X-Accept-Language: en-us
MIME-Version: 1.0
To: Koen Van Leemput <koen.vanleemput@hus.fi>
Subject: Re: [Insight-users] Bug in itkPNGImageIO
References: <200207151428.51348.koen.vanleemput@hus.fi>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


Hi Koen,

Thanks a lot for your bug report.
Following your description the bug was fixed.
You can cvs-update in order to get the corrected version.

Also the "%s%d.png" format was changed for "%s%03d.png"
in order to generate numbers like:

           001,002,003,..,010,..,100

instead of

           1,2,3....,10,....,100

In this way, when filenames are ordered lexicografically
the order is consistent with the position of slices in
the image.


An Example was added to:

       Insight/Examples/RawImageReadWrite

it is called :

       itkRawImageReadWritePNG.cxx

It reads a Raw image and dump all the slices into PNG files.

This can be used as an utility in itself.


Thanks again,


   Luis


======================================================

Koen Van Leemput wrote:

> When writing a 3-D image with itkPNGImageIO, all the files "%s%d.png" contain 
> the same first slice of the data set. This appears to be causes by 
> 
> 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   = FileSinkType::New();
> PNGWriterType::Pointer   PNGWriter  = PNGWriterType::New();
> 
> fileSink->SetImageIO( PNGWriter );
> fileSink->SetFilePrefix( outputFilePrefix );
> fileSink->SetInput( fileSource->GetOutput() );
> fileSink->Write();
>  
> This should be easy to fix...
> 
> Koen
> 
> 
> 





--------------020003080101060406020308--