[vtkusers] Variable transparancy on vtkImageData

Charlotte Curtis c.f.curtis at gmail.com
Wed Sep 9 12:12:04 EDT 2009


Hi Mark,

I ran into a similar problem a while back (although I was trying to
use a 2D actor, which apparently can't handle transparency), and I ran
across a couple of things that might help.

Is your image/renderer the only thing being displayed?  By default,
the deepest layer of the renderer is treated as opaque.  Try calling
renderer->PreserveDepthBufferOn() to force transparency at layer 0.
You can test if this is working by printing out the output to
renderer->Transparent().

The other thing I might try is using vtkImageMapToColors instead of
vtkImageMapToWindowLevelColors, as the latter is designed (AFAIK) to
map a range of greys in medical images to 0-255, so transparency might
be disabled.

If those don't work, maybe post your LookupTable creation code so we
can see how you're setting the values?

Good luck,

Charlotte

On Wed, Sep 9, 2009 at 7:57 AM, Mark Gooding<mark.gooding at gmail.com> wrote:
> I'm trying to render an image with transpanency proportional to the
> intensity the ImageActor input is being produced via
> vtkImageMapToWindowLevelColors, and I'm setting a vtkLookupTable for
> that. The alpha range of the vtkLookupTable (if set using
> SetAlphaRange) seems to make no difference to the transparency of the
> final ImageActor.
>
> Is there a limitation in one of these classes which prevents this from
> working as I expected?
>
> Once again my searching on the web/this mailing list hasn't helped me
> answer this question.
>
> Cheers,
>
> Mark
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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