[vtkusers] vtkImageMapToWindowLevelColors help

Luca Pamparana luca.pamparana at gmail.com
Tue Apr 17 10:19:31 EDT 2007


Hey Anka,

Thanks again for the reply.

The thing is that I am using the reslicer to extract a 2D slice and just
display that. All the interpolation, orientation, which slice to extract
etc. is controlled by the reslicer.

The vtkImageActor seems to have its own corresponding methods for these
operations. I am wondering if these can coexist... Only one way to find out,
I guess! Time for try some quick hack...

Thanks,
Luca.

On 4/17/07, Anka Kochanowska <anka at bic.mni.mcgill.ca> wrote:
>
> 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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070417/d8f1bbcb/attachment.htm>


More information about the vtkusers mailing list