[Insight-users] Re: Specify output png bit depth

Luis Ibanez luis.ibanez at kitware.com
Fri, 09 Jan 2004 15:25:58 -0500


Hi Mark,


If you declare the Writer as

   itk::ImageFileWriter< itk::Image< unsigned char, 2 > >

then the generated PNG will have 8 bits depth

--

If you declare the Writer as

    itk::ImageFileWriter< itk::Image< unsigned short, 2 > >

then the generated PNG will have 16 bits depth

--

If you need to modify the pixel depth before
writing you can use the RescaleIntensitImageFilter.
http://www.itk.org/Insight/Doxygen/html/classitk_1_1RescaleIntensityImageFilter.html


This filter is described in the SoftwareGuide

   http://www.itk.org/ItkSoftwareGuide.pdf


Section 6.2, pdf-page 146.


Regards,


    Luis


----------------------------------
Mark Walter Wyszomierski wrote:

> Hi All,
> 
> When running the samples in itk that output images and specifying png's
> for output, I could not find a way to specify what bit depth the resulting
> png image would be created in. Is there a way to specify that parameter?
> 
> 
> Thanks,
> Mark
> 
>