[vtkusers] vtkImagePlaneWidget Transparency/Windowing Problems

Miroslav Drahos mdrahos at thinksurgical.com
Fri Apr 24 18:02:01 EDT 2015


Try
planeWidget->GetTexturePlaneProperty()->SetOpacity(0.5);

Best,
Miro

________________________________________
From: vtkusers [vtkusers-bounces at vtk.org] On Behalf Of David Kushner [root at davidkushner.me]
Sent: Friday, April 24, 2015 2:18 PM
To: vtkusers at vtk.org
Subject: [vtkusers] vtkImagePlaneWidget Transparency/Windowing Problems

I'm currently building an application based heavily on the source provided in the QtVTKRenderWindows example (https://github.com/Kitware/VTK/blob/master/Examples/GUI/Qt/FourPaneViewer/QtVTKRenderWindows.cxx) using VTK 6.1. The only appreciable difference between my implementation and the one laid out in the example is the fact that, rather than using the vtkDICOMImageReader class, I'm loading our DICOM CT image in with ITK 4.8 and then converting it to the corresponding VTK image format using the itk::ImageToVTKImageFilter. I'm not sure if this is relevant to the issue I'm having, but I figure it couldn't hurt.

The issue is, though the image loads and renders just fine, the windowing applied to the image does not display transparency for out-of-window values as I would expect (and maybe this expectation is completely silly). The pixel type I'm using for the images, since they are CT scans, is `signed short`. The result I am seeing when I start my application is this:

[cid:ii_14ced4775ccffd82]
(http://i.imgur.com/vRkN0Ak.png)

Apologies if it is inappropriate to paste images inline or at all. As you can see, though the background values contained in the CT slice solid black, they are not exhibiting transparency as I would expect (or hope to achieve). Would anyone have some advice on how to achieve a transparency effect with this setup? I've tried a number of things from fiddling with the windowing of the plane widgets, the windowing values and color map of the renderer itself and then converting the image to an RGBA image before sending it on to the plane widgets. None of these seemed to have any effect on the outcome; the planes still rendered as opaque.

Any help would be GREATLY appreciated. It seems to me to be such a simple task yet I've mired myself in the complexities of ITK/VTK.


More information about the vtkusers mailing list