[vtkusers] Re: vtkImagePlaneWidget problem on vtkImageData (C++)

Dean Inglis dean.inglis at camris.ca
Thu Oct 28 13:22:07 EDT 2004


Adrian,

tyry using class vtkImageViewer2, as it was meant for 2D image display
and has built in window-level functionality controlled by the mouse.
vtkImagePlaneWidget is really designed to work with 3D image data.

Dean


I have a simple 2D-image (vtkImageData). I want to be able to change the
window-level by the mouse. So I used a vtkImagePlaneWidget, which implements
that. Actual it works, but not as expected:
The widget seems to be like a fog over the image. Some pixels habe the
original color, others have been set to black. If I turn the widget by one
of it's margins, I see again the proper image.

vtkImageData* myImageData;
vtkImagePlaneWidget* = myImagePlaneWidget;
vtkLookupTable* = myLookupTable;

//initialization ...

myImagePlaneWidget->SetInput(myImageData);
myImagePlaneWidget->SetPlaneOrientation(2); //Z-Axe
myImagePlaneWidget->On();
myImagePlaneWidget->SetSlicePosition(0);
myImagePlaneWidget->GetLookuptable()->DeepCopy(myLookupTable);

//more code ...

Can anybody help?

Thanks

Adrian





More information about the vtkusers mailing list