<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 9pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><FONT size=3>thank you , Cory ,</FONT><BR>
<FONT size=3></FONT>&nbsp;<BR>
<FONT size=3>&nbsp;&nbsp;&nbsp; my volume renderer is composite : vtkVolumeRayCastCompositeFunction .</FONT><BR>
<FONT size=3>&nbsp;&nbsp;&nbsp; </FONT><BR>
<FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;and I think there should be a class to do image format transformation if the volume renderer asks </FONT><BR>
<FONT size=3>for a different format images . </FONT><BR>
<FONT size=3></FONT>&nbsp;<BR>
<FONT size=3>&nbsp;&nbsp;&nbsp; thank you&nbsp;again , I would test it at once&nbsp;, and I&nbsp;will&nbsp;send it to the list .</FONT><BR>
<FONT size=3>&nbsp;&nbsp;&nbsp; </FONT><BR>
<FONT size=3>&nbsp;&nbsp;&nbsp; Mark</FONT><BR>
<BR><BR><BR><BR>&nbsp;<BR>

<HR id=stopSpelling>
<BR>
&gt; Date: Thu, 13 Sep 2007 22:57:44 -0400<BR>&gt; From: cquammen@cs.unc.edu<BR>&gt; To: zhaojunxp@hotmail.com<BR>&gt; Subject: Re: [vtkusers] How To Change A 24 Bits BMP Picture To A 8 Bits ?<BR>&gt; CC: vtkusers@vtk.org<BR>&gt; <BR>&gt; Mark,<BR>&gt; <BR>&gt; Please keep your response on the list so that if someone with a<BR>&gt; similar question searches the archive, they may find this thread.<BR>&gt; <BR>&gt; Looking at the source code of vtkBMPReader, 24-bit BMPs are read in as<BR>&gt; standard 3 color channel images (RGB) where each channel is 8-bits.<BR>&gt; What do you BMP's look like in a standard image viewer? If they are<BR>&gt; grayscale images where each color channel at each pixel has the same<BR>&gt; value, you can simply extract one of the 8-bit components as I<BR>&gt; suggested and pass the output of the vtkImageExtractComponents filter,<BR>&gt; which is now an 8-bit image, to the volume renderer you are using.<BR>&gt; <BR>&gt; By the way, what volume renderer are you using?<BR>&gt; <BR>&gt; Cory<BR>&gt; <BR>&gt; On 9/13/07, JohnMark &lt;zhaojunxp@hotmail.com&gt; wrote:<BR>&gt; &gt;<BR>&gt; &gt; Thank you , Cory ,<BR>&gt; &gt;<BR>&gt; &gt; what I do is not to extract a single color channel from the 24-bit BMP<BR>&gt; &gt; images , but to do volume<BR>&gt; &gt; rendering . my code is :<BR>&gt; &gt;<BR>&gt; &gt; vtkBMPReader *reader = vtkBMPReader::New();<BR>&gt; &gt; reader-&gt;SetDataExtent(0, 299, 0, 299, 1, 5);<BR>&gt; &gt; reader-&gt;SetFilePrefix("../Data/CT");<BR>&gt; &gt; reader-&gt;SetDataByteOrderToLittleEndian();<BR>&gt; &gt; reader-&gt;Allow8BitBMPOn();<BR>&gt; &gt; reader-&gt;SetDataMask(0x7fff);<BR>&gt; &gt; reader-&gt;SetDataSpacing(3.2,3.2,3.5);<BR>&gt; &gt; reader-&gt;SetDataOrigin(0.0,0.0,0.0);<BR>&gt; &gt;<BR>&gt; &gt; and I think you can see easily : reader-&gt;Allow8BitBMPOn(); that is ,<BR>&gt; &gt; the reader ask for the 8-bit<BR>&gt; &gt; BMP images . but I only have 24-bit BMP images , so my volume rendering is<BR>&gt; &gt; just a cube , and there is<BR>&gt; &gt; something I can't see clearly in the " cube " . and in a word , if I would<BR>&gt; &gt; get the volume rendering ,<BR>&gt; &gt; I should use the 8-bit BMP images .<BR>&gt; &gt;<BR>&gt; &gt; So my question is : are there any classes in VTK that I can use to<BR>&gt; &gt; change the 24-bit BMP images to<BR>&gt; &gt; 8-bit ?<BR>&gt; &gt;<BR>&gt; &gt; Thank you for your help again !<BR>&gt; &gt;<BR>&gt; &gt; Mark<BR>&gt; &gt;<BR><BR><br /><hr />使用新一代 Windows Live Messenger 轻松交流和共享! <a href='http://messenger.live.cn/' target='_new'>立即体验!</a></body>
</html>