<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1500573583193_3800"><span id="yui_3_16_0_ym19_1_1500573583193_3845">Thanks, that's the workaround I'm using for the moment.</span></div><div id="yui_3_16_0_ym19_1_1500573583193_3800"><span><br></span></div><div id="yui_3_16_0_ym19_1_1500573583193_3800"><span>Mike</span></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1500573583193_3810"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1500573583193_3873" style="display: block;"> <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1500573583193_3872"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1500573583193_3871"> <div dir="ltr" id="yui_3_16_0_ym19_1_1500573583193_3870"> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> David Gobbi <david.gobbi@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Mike Withascarf <mikewithascarf@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "vtkusers@vtk.org" <vtkusers@vtk.org><br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, July 20, 2017 8:33 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [vtkusers] vtkImageBlend output alpha<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1500573583193_3874"><br><div id="yiv0030766608"><div id="yui_3_16_0_ym19_1_1500573583193_3876"><div dir="ltr" id="yui_3_16_0_ym19_1_1500573583193_3875">Hi Mike,<div id="yui_3_16_0_ym19_1_1500573583193_3877"><br clear="none"></div><div id="yui_3_16_0_ym19_1_1500573583193_3878">There is no way to change this behavior for vtkImageBlend. One solution is to use a dummy image as input 0 (same dimensions as your first image, but with RGBA set to 0,0,0,1 for all pixels), and then add your two images as inputs 1 and 2.</div><div id="yui_3_16_0_ym19_1_1500573583193_3879"><br clear="none"></div><div id="yui_3_16_0_ym19_1_1500573583193_3880"> - David <br clear="none"><div class="yiv0030766608yqt4413184331" id="yiv0030766608yqt82835"><div class="yiv0030766608gmail_extra" id="yui_3_16_0_ym19_1_1500573583193_3881"><br clear="none"><div class="yiv0030766608gmail_quote" id="yui_3_16_0_ym19_1_1500573583193_3885">On Wed, Jul 19, 2017 at 10:49 AM, Mike Withascarf via vtkusers <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:vtkusers@vtk.org" target="_blank" href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>></span> wrote:<br clear="none"><blockquote class="yiv0030766608gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;" id="yui_3_16_0_ym19_1_1500573583193_3884"><div id="yui_3_16_0_ym19_1_1500573583193_3883"><div style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;" id="yui_3_16_0_ym19_1_1500573583193_3882"><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3653">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!</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3653"><br clear="none"></div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3653">This is a simplified version of the code I'm using:</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3653"><br clear="none"></div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3856">vtkSmartPointer<vtkImageMapToC olors> imapper1 = vtkSmartPointer<vtkImageMapToC olors>::New();</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3857">imapper1->SetLookupTable(lut1) ;</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3858">imapper1->PassAlphaToOutputOn( );</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3859">imapper1->SetInputData(image1) ;</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3860">imapper1->Update();</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3861"><br clear="none" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3862"></div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3863">vtkSmartPointer<vtkImageMapToC olors> imapper2 = vtkSmartPointer<vtkImageMapToC olors>::New();</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3864">imapper2->SetLookupTable(lut2) ;</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3865">imapper2->PassAlphaToOutputOn( );</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3866">imapper2->SetInputData(image2) ;</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3867">imapper2->Update();</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3868"><br clear="none" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3869"></div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3870">vtkSmartPointer<vtkImageBlend> blend = vtkSmartPointer<vtkImageBlend> ::New();</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3871">blend->AddInputConnection(imap per1->GetOutputPort());</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3872">blend->SetOpacity(0, 1.0);</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3873">blend->AddInputConnection(imap per2->GetOutputPort());</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3874">blend->SetOpacity(1, 1.0);</div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3874"><br clear="none"></div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3874">// If I now render and adjust lut1, it affects the output of blend so the imapper2 image gets affected</div><span class="yiv0030766608m_8147260923843896409HOEnZb"><font color="#888888"></font></span><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3653"><br clear="none"></div><div dir="ltr" id="yiv0030766608m_8147260923843896409m_-2192334854636949855yui_3_16_0_ym19_1_1500482535878_3653">Mike</div></div></div></blockquote></div></div></div></div></div></div></div><br><br></div> </div> </div> </div></div></body></html>