[vtkusers] Show image in grey scale

David Doria daviddoria at gmail.com
Mon Sep 12 10:15:07 EDT 2011


On Mon, Sep 12, 2011 at 10:13 AM, David Brayford <dbrayford at gmail.com> wrote:
> Hi,
>
> I have a grey scale X-Ray image that when I load it into vtk the image
> is multi-coloured and was wondering how I can show the image as a
> plane grey scale x-ray image.
>
> Below is the code:
>
>                        xray.imagePlane->SetCenter( temp );
>                        xray.mapper->SetInput(xray->GetOutput());
>                        xray.actor->SetTexture( imageTexture );
>                        xray.actor->SetMapper(xray].mapper);
>                        xray.actor->GetProperty()->SetOpacity(0.8);
>
> Thanks
> David

You can convert the actual data to greyscale using one of:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ConvertToGreyScale
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageLuminance

David



More information about the vtkusers mailing list