[vtkusers] vtkImageMapToWindowLevelColors help

Luca Pamparana luca.pamparana at gmail.com
Tue Apr 17 04:54:07 EDT 2007


Hello everyone,

I am unable to get the vtkImageMapToWindowLevelColors to give me an output
:(

My pipeline is as follows:

// vtkImageData input to a reslicer
this->m_slicer->SetInput(in);

// pass the output of the slicer to vtkImageMapToWindowLevelColors object
this->m_windowLevelMapper->SetInputConnection(this->m_slicer->GetOutputPort());


// Pipe the output to a vtkImageBlend object
this->m_blender->AddInputConnection(0,
this->m_windowLevelMapper->GetOutputPort());

// Pipe output to a vtkImageMapper. This mapper is tied to the Actor2D
// object that is added to the renderer
this->m_imageMapper->SetInput(this->m_blender->GetOutput());

double * range = in->GetScalarRange();
if (range)
{
      // this calls the ciorresponding methods on the
vtkImageMapToWindowLevelColors object
       this->SetColorWindow(range[1] - range[0]);
       this->SetColorLevel(0.5 * (range[1] + range[0]));
 }

SetSlice(static_cast<int>((GetWholeZMin() + GetWholeZMax()) * 0.5));

My guess is that I am not setting the ColorWindow and ColorLevel on the
vtkImageMapper instance. However, I want to control the color window and
color level values independently of the mapper as the vtkImageBlend will
also have other inputs that I want to control the window and level values
for.

Any help on how I can get this to work is much appreciated.

Thanks,
Luca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070417/689717a4/attachment.htm>


More information about the vtkusers mailing list