[vtkusers] Transparency

Gomez, Alberto alberto.gomez at kcl.ac.uk
Tue Feb 23 12:48:48 EST 2010


Hi,

You can set a point of your opacity transfer function (i.e. one scalar 
value) to transparent without changing the rest. For example, if you are 
using vtkPiecewiseFunction, then you set it up as you like and you 
remove the 0 value with the method RemovePoint(0):

vtkSmartPointer<vtkPiecewiseFunction> volumeScalarOpacity =
vtkSmartPointer<vtkPiecewiseFunction>::New();

volumeScalarOpacity->AddSegment(-10,0.5,10,0.5);
volumeScalarOpacity->RemovePoint(0);



Banks, Robert wrote:
> Hi all.
>
> Two questions, although the answer for one, may be the same for the other.
>
> I have a dataset that is the cross sectional displacement of a model. However, that model is in void, so there is no displacement in the void. When I plot the info, I get a large band of color around the data relating to the 0 value of the displacement in void. Is it possible to hide or make this data transparent? Or should I window the data?
>
> I’m thinking, I could set this color value to transparent, but am not sure how this would affect the rest of the data, having a transparent color data value in the middle of the plotting range.
>
> The second question is on a similar vein. Using the same example, if I have a model of, say 5 different materials, which I have defined each material as a different color. Can I just set that color value to fully transparent to hide it in the rendered picture?
>
> Or is there a better way to achieve the described problems?
>
> Thanks
> Robbie
>
>
> Robbie Banks
>
>
> ---------------------------------------------------------------------------------------------------
> Weidlinger Associates, Inc. made the following annotations.
>
> “This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”
>
> “Please consider our environment before printing this email.”
>
>   


-- 

Alberto Gómez

/Division of Imaging Sciences
The Rayne Institute
4th Floor, Lambeth Wing
St Thomas' Hospital
London SE1 7EH /

phone: +44 (0) 20 718 88364
email: alberto.gomez at kcl.ac.uk <mailto:alberto.gomez at kcl.ac.uk>




More information about the vtkusers mailing list