[vtkusers] How to adjust VTK Image brightness and contrast with QT Slider

Jothybasu Selvaraj jothybasu at gmail.com
Tue Feb 14 04:09:50 EST 2012


It should be some thing like this

// Create a greyscale lookup table

        vtkSmartPointer<vtkLookupTable> table =

          vtkSmartPointer<vtkLookupTable>::New();

        table->SetRange(windowLow,windowUp); // image intensity range

        table->SetValueRange(0.0, 1.0); // from black to white

        table->SetSaturationRange(0.0, 0.0); // no color saturation

        table->SetRampToLinear();

        table->Build();

        // Map the image through the lookup table

        vtkSmartPointer<vtkImageMapToColors> color =

          vtkSmartPointer<vtkImageMapToColors>::New();

        color->SetLookupTable(table);

        color->SetInputConnection(reslice->GetOutputPort());



Jothy



On Mon, Feb 13, 2012 at 5:48 PM, yarram <somasekhar.vit at gmail.com> wrote:

> @Jothy: I am new to this VTK, so could you provide me the sample code/
> snippet for controlling the image contrast and brightness with QT slider??
> Thanks in advance......
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/How-to-adjust-VTK-Image-brightness-and-contrast-with-QT-Slider-tp5473398p5479994.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120214/92159cef/attachment.htm>


More information about the vtkusers mailing list