[vtkusers] efficient way to set opacity pixelwise?

hchen hjchen.work at gmail.com
Tue May 31 16:40:38 EDT 2016


Hello, 

Does anyone know if there is an efficient way of setting opacity pixelwise,
eg. using luminance of a pixel for its opacity? 

I am writing an application where I need to overlay a few images (eg, a
slice of CT, and then a few planned and measured doses, the doses have a lot
zeros), I have been using SetOpacity in vtkImageBlend or vtkImageProperty,
it works OK, but it feels like the more layers displayed, the duller the
bottom layers becomes. So, I am trying to set opacity for layers( except the
bottom one ) according their pixel value to see if it will do better. As for
now, I first use vtkImageMapToColors to convert to RGBA, then loop through
each pixel using SetComponent in vtkArrayData to set opacity pixelwise. The
program is written in python, so the looping is not particularly efficient. 

If anyone knows a better way of setting opacity on a per-pixel base, I would
appreciate a lot!

Thanks!

Chen 

 



--
View this message in context: http://vtk.1045678.n5.nabble.com/efficient-way-to-set-opacity-pixelwise-tp5738533.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list