[vtkusers] vtkImageMapToWindowLevelColors help

Anka Kochanowska anka at bic.mni.mcgill.ca
Tue Apr 17 09:28:36 EDT 2007


I am using vtkImageActor:


        vtkImageActor * mriActor;
...
...
        blendedImage->AddInput( 0, img1->GetOutput());
        blendedImage->AddInput( 0, 
.displayWindowLevelColorsImage->GetOutput());
        blendedImage->Update();
        mriActor->SetInput(blendedImage->GetOutput());
        renderer->AddViewProp( mriActor );
Anka

Luca Pamparana wrote:

> 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
>
>------------------------------------------------------------------------
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>  
>



More information about the vtkusers mailing list