[vtk-developers] LookupTable + ImagePlaneWidget

Dean Inglis dean.inglis at camris.ca
Tue May 2 15:05:33 EDT 2006


Hi,

you need to access the buffer from the underlying vtkImageMapToColors:
vtkImageMapToColors  *ColorMap;

since the resliced output gets set in:

void vtkImagePlaneWidget::SetInput(vtkDataSet* input)
{
...
this->ColorMap->SetInput(this->Reslice->GetOutput());
...
}

you can set the color map externally due to the following macro
defined in vtkImagePlaneWidget.cxx:

vtkCxxSetObjectMacro(vtkImagePlaneWidget, ColorMap, vtkImageMapToColors);

just do

vtkImageMapToColors* myColorMap = vtkImageMapToColors::New();
widget->SetColorMap(myColorMap);

and access the buffer as you like.

In future, please post such questions to the user's list and not the
developer's list.

regards,
Dean





hello,
I'm using the vtkImagePlaneWidget in my project for a 3d recontitution use,
under Qt.
but I'm not using the vtkViewer but an OpenGl widget (QGLWidget), so I
recover the adresse of the image-buffer like following :
planeX=vtkImagePlaneWidget::New();
.....
uchar * Imgbuffer;
Imgbuffer =(uchar *)planeX->GetResliceOutput()->GetScalarPointer();
After that I create the image using Qt routines then I display its texture
in the QGLWidget.
the problem that when I use the SetWindowLevel (double window, double
level), the appearance of the image in QVTKwidget ( that I use for test) is
changing while I'm changing the values of Window and level but when I
recover the buffer of  the image nothing change.
So, is it possible to telle me , how can I recover the changer image by the
lookupthable or how to recover the lookuptable and use after that to change
my image.
thak you!




More information about the vtk-developers mailing list