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