[vtkusers] vtkColorTransferFunction and opacity
Steve Joyce
Steve.Joyce at sercoassurance.com
Wed Jan 28 11:49:59 EST 2004
Lisa,
Thanks for your reply.
In my case I wanted to set the transparency for each dataset and
judging from previous postings other people have wanted to do the same.
Certainly this is the behaviour you would expect from
vtkActor.GetProperty().SetOpacity(...). This opacity eventually gets set
as the alpha value in vtkScalarsToColors.
I agree that having an opacity per scalar value would also be useful.
Thanks,
Steve
>>> Lisa Avila <lisa.avila at kitware.com> 28/01/2004 15:48:56 >>>
Hi Steve,
I think this Alpha value is not used because it is part of the
superclass
vtkScalarsToColors and vtkColorTransferFunction was not originally a
subclass of this class. It can be used - but I suspect you will need to
test that the alpha value is being set everywhere it needs to be set.
This
also only allows you to have a single opacity for the whole image - and
I
think what people want is an opacity per scalar value. What we real
need is
to associate a vtkPiecewiseFunction with a vtkColorTransferFunction for
this - of course these are separately specified in the
vtkVolumeProperty
for volume rendering so this could be confusing...
Lisa
At 10:03 AM 1/28/2004, Steve Joyce wrote:
>Hi,
>
>Setting the opacity of actors does not work when using a
>vtkColorTransferFunction as the colour lookup table. This is because
the
>alpha value for a colour is always returned as 255 by
>vtkColorTransferFunction.
>
>As a fix for this I replaced the places where this occurred in
>vtkColorTransferFunction with
>(unsigned char)(this->GetAlpha() * 255.0)
>or
>(unsigned char)(self->GetAlpha() * 255.0)
>as appropriate.
>
>This seemed to work for me, so I was wondering why it was fixed at
255
>in the first place. Am I doing the wrong thing?
>
>Thanks,
>Steve
>
>
>
>
>
>****Disclaimer***********
>This e-mail and any attachments may contain confidential and/or
privileged
>material; it is for the intended addressee(s) only. If you are not a
>named addressee, you must not use, retain or disclose such
information.
>
>Serco cannot guarantee that the e-mail or any attachments are free
from
>viruses.
>
>The views expressed in this e-mail are those of the originator and do
not
>necessarily represent the views of Serco.
>
>Nothing in this e-mail shall bind Serco in any contract or
obligation.
>
>Serco Group plc. Registered in England and Wales. No: 2048608
>Registered Office: Serco House, 16 Bartley Wood Business Park,
Bartley
>Way, Hook, Hampshire, RG27 9UY, United Kingdom.
>****End Disclaimer*******
><<<<GWIASIG 0.07>>>>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list