[vtkusers] ImageBlending in Compound Mode

Böttcher, Prof. Dr. Peter Boettcher at kleintierklinik.uni-leipzig.de
Mon May 25 14:50:07 EDT 2015


Dear All

I have two vtkImageData which I map to grey and green color using vtkImageMapToWindowLevelColors->SetOutputFormatToRGBA. The two LookUps are manually defined like this:

                  tableGreen->SetTableRange(0,256-1);
                  tableGreen->Build();
                  for(float i=1; i<256; i++)
                  tableGreen->SetTableValue(i,0,i/(256-1),0.0,1.0); // Green
                  tableGreen->SetTableValue(0,0.0,0.0,0.0,0.0); // Background

                  tableGrey->SetTableRange(0,256-1);
                  tableGrey->Build();
                  for(float i=0; i<256; i++)
                  tableGrey->SetTableValue(i,i/(256-1),i/(256-1), i/(256-1),1.0); // Grey


Using vtkImageBlend I would like to blend both images using different opcity values (0 - 1), but ignoring any black pixel in the green image, by using SetCompoundMode and CompoundThreshold = 0.

m_blend_A->SetInput(0, GreyImage);
            m_blend_A->SetOpacity(0, 0.3);
            m_blend_A->SetInput(1, GreenImage);
            m_blend_A->SetOpacity(1, 0.7);
            m_blend_A->SetBlendModeToCompound();
            m_blend_A->SetCompoundThreshold(0);
            m_blend_A->Update();

Whatever I do, the "black" pixels (background) in the green image are still overlayed on the grey image pixels. However, when I turn the threshold to anything other than 0 no pixel at all are pushed trough the blender (neither the green nor the grey image).

Any help would be much appreciated.

Thanks - Peter



---------------------------------------------------------
Prof. Dr. Peter Böttcher, DipECVS
European Veterinary Specialist in Surgery
Fachtierarzt für Kleintierchirurgie
Klinik für Kleintiere
Universität Leipzig
An den Tierkliniken 23
D-04103 Leipzig (Germany)
Tel: +49-341-9738700
Fax: +49-341-9738799
Email: boettcher at kleintierklinik.uni-leipzig.de<mailto:boettcher at kleintierklinik.uni-leipzig.de>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150525/5bbb5531/attachment.html>


More information about the vtkusers mailing list