<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o = "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2668" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Your calculus seem good.</FONT></DIV>
<DIV><FONT face=Arial size=2>In your original and final image, what are the 
maximum and minimum in the pixel values ?</FONT></DIV>
<DIV><FONT face=Arial size=2>If the ratio between the max and the number of 
possible values for the original and final images</FONT></DIV>
<DIV><FONT face=Arial size=2>are same, then your conversion is 
correct.</FONT></DIV>
<DIV><FONT face=Arial size=2>In this case, it will only be a lookup table 
problem. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Cheers</FONT></DIV>
<DIV><FONT face=Arial size=2>Benoit Regrain</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV>
<DIV><BR></DIV></FONT>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=olivier.stern@swing.be 
  href="mailto:olivier.stern@swing.be">olivier.stern@swing.be</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=Dcmlib@creatis.insa-lyon.fr 
  href="mailto:Dcmlib@creatis.insa-lyon.fr">Dcmlib@creatis.insa-lyon.fr</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, August 09, 2005 3:59 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Dcmlib] Image conversion</DIV>
  <DIV><BR></DIV><BR>
  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN 
  lang=EN-GB style="mso-ansi-language: EN-GB">Hello,<o:p></o:p></SPAN></P>
  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN 
  lang=EN-GB style="mso-ansi-language: EN-GB"> <o:p></o:p></SPAN></P>
  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN 
  lang=EN-GB style="mso-ansi-language: EN-GB">I have a little trouble converting 
  images. I got DICOM images with 16 bits allocated, 12 bits stored and 11 as 
  high bit. I'd like to change them to 8 bits allocated, 8 bits stored and 7 as 
  high bit.<o:p></o:p></SPAN></P>
  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN 
  lang=EN-GB style="mso-ansi-language: EN-GB"> <o:p></o:p></SPAN></P>
  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN 
  lang=EN-GB style="mso-ansi-language: EN-GB">What I've done first was taking 
  the highest value of pixels on one image and the lowest, and made a conversion 
  to value between 0 and 255 (thanks to Jean-Perre Roux). But this conversion 
  wasn't the same from one image to another because the highest value and the 
  lowest change. What I need is a constant conversion so what I 've done 
  is: as the highest theoric value that a file with 12 bits stored can take is 
  4095 and a file with 8 bits stored is 255, all pixels of the original images 
  were devised by 16 (4096/256 = 16). But the output image was very 
  dark, either deleting 0x0028,0x1050 and 0x0028,0x1051. If I devise by 4 I get 
  a relatively good result but I can't say why. Could anyone explain me if what 
  I m doing is correct?<BR><BR>Olivier<o:p></o:p></SPAN></P>
  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB 
  style="mso-ansi-language: EN-GB"><o:p> </o:p></SPAN></P><BR><BR>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Dcmlib mailing 
  list<BR>Dcmlib@creatis.insa-lyon.fr<BR>http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib</BLOCKQUOTE></BODY></HTML>