[vtkusers] How To Change A 24 Bits BMP Picture To A 8 Bits ?

JohnMark zhaojunxp at hotmail.com
Thu Sep 13 23:06:06 EDT 2007


thank you , Cory ,
 
    my volume renderer is composite : vtkVolumeRayCastCompositeFunction .
    
    and I think there should be a class to do image format transformation if the volume renderer asks 
for a different format images . 
 
    thank you again , I would test it at once , and I will send it to the list .
    
    Mark
 



> Date: Thu, 13 Sep 2007 22:57:44 -0400> From: cquammen at cs.unc.edu> To: zhaojunxp at hotmail.com> Subject: Re: [vtkusers] How To Change A 24 Bits BMP Picture To A 8 Bits ?> CC: vtkusers at vtk.org> > Mark,> > Please keep your response on the list so that if someone with a> similar question searches the archive, they may find this thread.> > Looking at the source code of vtkBMPReader, 24-bit BMPs are read in as> standard 3 color channel images (RGB) where each channel is 8-bits.> What do you BMP's look like in a standard image viewer? If they are> grayscale images where each color channel at each pixel has the same> value, you can simply extract one of the 8-bit components as I> suggested and pass the output of the vtkImageExtractComponents filter,> which is now an 8-bit image, to the volume renderer you are using.> > By the way, what volume renderer are you using?> > Cory> > On 9/13/07, JohnMark <zhaojunxp at hotmail.com> wrote:> >> > Thank you , Cory ,> >> > what I do is not to extract a single color channel from the 24-bit BMP> > images , but to do volume> > rendering . my code is :> >> > vtkBMPReader *reader = vtkBMPReader::New();> > reader->SetDataExtent(0, 299, 0, 299, 1, 5);> > reader->SetFilePrefix("../Data/CT");> > reader->SetDataByteOrderToLittleEndian();> > reader->Allow8BitBMPOn();> > reader->SetDataMask(0x7fff);> > reader->SetDataSpacing(3.2,3.2,3.5);> > reader->SetDataOrigin(0.0,0.0,0.0);> >> > and I think you can see easily : reader->Allow8BitBMPOn(); that is ,> > the reader ask for the 8-bit> > BMP images . but I only have 24-bit BMP images , so my volume rendering is> > just a cube , and there is> > something I can't see clearly in the " cube " . and in a word , if I would> > get the volume rendering ,> > I should use the 8-bit BMP images .> >> > So my question is : are there any classes in VTK that I can use to> > change the 24-bit BMP images to> > 8-bit ?> >> > Thank you for your help again !> >> > Mark> >
_________________________________________________________________
Windows Live Custom Domain,您的免费电子邮局。
https://domains.live.com/default.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070914/9fb3d9e1/attachment.htm>


More information about the vtkusers mailing list