<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif"><small>Hi Emma,<br>
<br>
Please read the ITK Software Guide, in particular Chapter 7: Reading
and Writing Image, and Section 6.3: Casting and Intensity Mapping:<br>
&nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.itk.org/ItkSoftwareGuide.pdf">http://www.itk.org/ItkSoftwareGuide.pdf</a><br>
<br>
If the pixel type your specify is not the same as the underlying pixel
type on disk, then the ImageIO object uses a <font
 face="Courier New, Courier, monospace">static_cast</font> to convert
the data, which can result in information loss if the given pixel type
is too short. For example, if the data is <font
 face="Courier New, Courier, monospace">signed short</font> on disk and
ranges from -1000 to +1000 (which is typical for CT images), then
reading as <font face="Courier New, Courier, monospace">unsigned char</font>
will result in information loss. However, if your data is <font
 face="Courier New, Courier, monospace">signed short</font> on disk and
ranges from 50 to 200, then reading as <font
 face="Courier New, Courier, monospace">unsigned char</font> will be
fine.<br>
<br>
Assuming you have read a 16-bit image without information loss, there
are a number of ways to 'convert' it to 8-bits -- depending on your
requirements. Please note these methods also result in 'information
loss', albeit in a somewhat more controlled manner. </small><small>One
possibility is to linearly rescale the values so that the minimum (eg.
-1000) maps to 0 and the maximum (eg. 1000) maps to 255. The <font
 face="Courier New, Courier, monospace">itkRescaleIntensityImageFilter</font>
achieves this:<br>
&nbsp;&nbsp;&nbsp;
<a class="moz-txt-link-freetext" href="http://www.itk.org/Doxygen/html/classitk_1_1RescaleIntensityImageFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1RescaleIntensityImageFilter.html</a><br>
<br>
You may also be interested in the <font
 face="Courier New, Courier, monospace">itkIntensityWindowingImageFilter</font>
which allows you to specify a focus window before rescaling:<br>
&nbsp;&nbsp;&nbsp;&nbsp;
<a class="moz-txt-link-freetext" href="http://www.itk.org/Doxygen/html/classitk_1_1IntensityWindowingImageFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1IntensityWindowingImageFilter.html</a><br>
<br>
HTH<br>
<br>
Cheers, Dan<br>
<br>
<br>
Emma Ryan wrote:</small></font>
<blockquote cite="mid764596.30679.qm@web57909.mail.re3.yahoo.com"
 type="cite">
  <style type="text/css"><small><!-- DIV {margin:0px;} --></small></style>
  <div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
  <div><font face="Helvetica, Arial, sans-serif"><small>Hi,<br>
  <br>
Just wanted to add....<br>
  <br>
If the dicom file were read as &lt;unsigned char, 2&gt;, how does it
convert the 16-bit to 8-bit ?<br>
  <br>
How does ITK handle 16-bit data conversion to 8-bit ?
For example : if I were to read a dicom series (16-bit) as 'signed
short 'and store it as a volume in .vtk format using OutputPixelType
&lt;unsigned char, 3&gt;, how does the conversion take place ?<br>
  <br>
Or this conversion not possible in ITK ?<br>
  <br>
Thanks in advance,<br>
Emma</small></font></div>
  </div>
</blockquote>
</body>
</html>