When you declare your image series reader use unsigned char as the type. The reader will produce the output type regardless of the actual type in the files themselves. It does so with a simple cast. This can be dangerous, but in your case, you know the values are less than 255.<br>
<br><div class="gmail_quote">On Tue, Sep 13, 2011 at 11:29 PM, Gib Bogle <span dir="ltr"><<a href="mailto:g.bogle@auckland.ac.nz">g.bogle@auckland.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I'm reading a set of 2D tiff images and writing a 3D tiff (essentially the example IO/ImageSeriesReadWrite.cxx). The 2D tiffs have 16-bit pixels, but the pixel values are all less than 255. I want the output file to be 8-bit. How should I do the conversion (the example ImageReadCastWrite uses RescaleIntensityImageFilter to convert between different pixel formats, but I do not want to rescale the values).<br>
______________________________<u></u>_______<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/<u></u>products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_<u></u>FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/<u></u>listinfo/insight-users</a><br>
</blockquote></div><br>