[vtkusers] vtkImageBlend

David Gobbi dgobbi at imaging.robarts.ca
Wed Nov 13 08:41:18 EST 2002


Hi Massimo,

You have to generate an alpha component for your images.  If
they are greyscale, you can send them through vtkImageMapToColors
with a vtkLookupTable that maps black to alpha=0, e.g.

# first build the lookup table
table = vtkLookupTable()
table.SetValueRange(0,1)
table.SetSaturationRange(0,0)
table.SetAlphaRange(1,1)
table.SetRampToLinear()
table.Build()
# set alpha of first value to 0 instead of 1
table.SetTableValue(0, 0,0,0,0)

If the image is RGB, then you have to take the magnitude of the image,
threshold it to create an alpha mask, then use vtkImageAppendComponents
to append the alpha mask to the image before blending it.

 - David

-- 
  David Gobbi, MSc                dgobbi at imaging.robarts.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Wed, 13 Nov 2002, Massimo Ivani wrote:

> Hello,
>
> I have some Bitmap Rx pictures and I want blend them using vtkImageBlend. I want that BLACK color is transparent color. How can I do that???
>
> Thank you in advance.
>
>
> Dr. Massimo Ivani
> Media Lab Software
> Tel.: +39 0187 517775
> Fax: +39 0187 511833
> massimo.ivani at mlsw.com
> www.mlsw.com
>




More information about the vtkusers mailing list