[vtkusers] Setting individual pixel's opacity.

David Gobbi dgobbi at atamai.com
Thu May 19 10:05:39 EDT 2005


Hi Michal,

Since your image is VTK_UNSIGNED_CHAR, you can use
vtkImageAppendComponents to append an alpha mask to your image.
To create the alpha mask, you could send your image through
vtkImageShiftScale with a "Scale" value of 255 and with "ClampOverflow" on.
That way all the mask pixels will be zero where your image is zero,
and 255 where your image is nonzero.

 - David

Sandarak wrote:

>Hello!
>
>Is it possible in VTK to set individual pixel's opacity in the image?
>Or is it possible to set opacity to pixels with the same value?
>
>I'm working with an image of VTK_UNSIGNED_CHAR type and I would like
>to set pixels with values 0  to be complately opaque, but I want to
>have all other pixles visible.
>
>I know that there is vtkLookupTable and I can use SetAlphaRange
>method. But it doesn't solve the problem.
>
>Thanks in advance
>
>Michal
>
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the 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