<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Thanks Bill,<br>
<br>
It turns out that what I knew was not the case. I was fooled by the
way Irfanview reports image info. In fact the files I've examined
so far have a max value of 4096, i.e. they are using 12 bits, stored
in 16 bits. There's probably a much easier way, but I've written
code to read each file and write the converted values into an 8-bit
3D image.<br>
<br>
Cheers<br>
Gib<br>
<br>
On 14/09/2011 3:37 p.m., Bill Lorensen wrote:
<blockquote
cite="mid:CADZJ4hO6UPCdZJwVCw3q=mjUFp9S5=o2DJAYh9TbLL314tONxw@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
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 moz-do-not-send="true"
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>
_____________________________________<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information
visit:<br>
<a moz-do-not-send="true"
href="http://www.kitware.com/products/protraining.html"
target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a moz-do-not-send="true"
href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://www.itk.org/mailman/listinfo/insight-users"
target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote>
</div>
<br>
</blockquote>
<br>
<br>
</body>
</html>