[vtkusers] Setting individual pixel's opacity.

Sandarak sandarak at wp.pl
Thu May 19 11:41:39 EDT 2005


Hi David,

Thank you for answer.

What should I do when I create alpha mask for my
Image?

I've tried to use vtkImageMask and it's SetMaskAlpha method.
But when I'm setting this method to 1 I'm getting mask image
pixel visible, and setting 0 makes original image pixel visible.
Thus this doesn't make those pixels opaque, but only the mask is
opaque.

Michal


> 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