[vtkusers] vtkImageBlend output alpha

Mike Withascarf mikewithascarf at yahoo.com
Wed Jul 19 12:49:05 EDT 2017


Hi, I'm using vtkImageBlend to blend two vtkImageMapToColors. Right now if I change the opacity map of the first vtkImageMapToColors (via lookup table), it adjusts the entire alpha of the output (so for example hiding the first one hides both of them). Is there a way to prevent vtkImageBlend from assigning the opacity of the first element to the output? I've tried using the "compound" blending mode in case that would help, but the screen is blank then. Any help would be great!
This is a simplified version of the code I'm using:
vtkSmartPointer<vtkImageMapToColors> imapper1 = vtkSmartPointer<vtkImageMapToColors>::New();imapper1->SetLookupTable(lut1);imapper1->PassAlphaToOutputOn();imapper1->SetInputData(image1);imapper1->Update();
vtkSmartPointer<vtkImageMapToColors> imapper2 = vtkSmartPointer<vtkImageMapToColors>::New();imapper2->SetLookupTable(lut2);imapper2->PassAlphaToOutputOn();imapper2->SetInputData(image2);imapper2->Update();
vtkSmartPointer<vtkImageBlend> blend = vtkSmartPointer<vtkImageBlend>::New();blend->AddInputConnection(imapper1->GetOutputPort());blend->SetOpacity(0, 1.0);blend->AddInputConnection(imapper2->GetOutputPort());blend->SetOpacity(1, 1.0);
// If I now render and adjust lut1, it affects the output of blend so the imapper2 image gets affected
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170719/a8d85180/attachment.html>


More information about the vtkusers mailing list