[vtkusers] MRI DICOM image black and white display???

Goodwin Lawlor goodwin.lawlor.lists at gmail.com
Tue Feb 25 09:52:46 EST 2014


Hi Hiliwi,

Set the window/level in the viewer - don't use a LUT.

imageViewer->SetColourWindow(1500)
imageViewer->SetColourLevel(150)

These values will map an intensity range from -600 to 900 (as in your
example) to a value range of 0.0 to 1.0 (black to white)

FYI, the above methods are just wrappers around
vtkImageMapper::SetColorWindow() and vtkImageMapper::SetColorLevel

hth

Goodwin




On Tue, Feb 25, 2014 at 8:53 AM, kidane <hiliwi.leake at gmail.com> wrote:

> I able to adjust it using lookuptable for a single dicom image. But when I
> tried to read and display a series of Dicom images I could't able to
> integrate the lookuptable.
>
> could anyone help me please??? the code is down.
>
>     reader = vtkSmartPointer<vtkDICOMImageReader>::New();
>     imageViewer = vtkSmartPointer<vtkImageViewer2>::New();
>
>         ///////////////////
>
>     reader->SetDirectoryName(folderDCM.c_str());
>     reader->Update();
>
>         vtkSmartPointer<vtkLookupTable> table =
> vtkSmartPointer<vtkLookupTable>::New();
>         table->SetRange(-600,900); // 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->SetInput(reader->GetOutput());
>          // Set the image                                      "here is the
> problem. I couldn't link it"
>          //reader->SetInput(color->GetOutput());
> ///////////////////////////////////////////////////////////////////////////
>     imageViewer->SetInputConnection(reader->GetOutputPort());
>
>     imageViewer->SetRenderWindow(ui->qVTK1->GetRenderWindow());
>
> kind rgards,
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/MRI-DICOM-image-black-and-white-display-tp5726091p5726102.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140225/5a3e96c6/attachment.html>


More information about the vtkusers mailing list