<div>Hi,</div><div>it works following way:</div>Normal (default) : This is the standard blending mode used by OpenGL and other graphics packages. The output always has the same number of components and the same extent as the first input. <b>The alpha value of the first input is not used in the blending computation, instead it is copied directly to the output.</b><br>
<br>output <- input[0]<br>foreach input i {<br> foreach pixel px {<br> r <- input[i](px)(alpha) * opacity[i]<br> f <- (255 - r)<br> output(px) <- output(px) * f + input(px) * r<br> }<br>}<br><br>Cheers<br>
On Mon, Oct 1, 2012 at 7:40 AM, <<a href="mailto:anupriya.sharma@accenture.com">anupriya.sharma@accenture.com</a>> wrote:<br>> Hi<br>><br>> <br>><br>> I am trying to blend two different raw files. I have used vtkImageReader to<br>
> read both the files. I have applied two different lookup tables on both the<br>> file<br>><br>> I have also used vtkImageMapToColors ColorMapper = new<br>> vtkImageMapToColors();<br>><br>> <br>
><br>> vtkImageMapToColors ColorMapper = new vtkImageMapToColors();<br>><br>> ColorMapper.SetInput(reader1.GetOutput());<br>><br>> ColorMapper.SetLookupTable(table);<br>
><br>> <br>><br>> vtkImageMapToColors ColorMapper1 = new<br>> vtkImageMapToColors();<br>><br>> ColorMapper1.SetInput(reader2.GetOutput());<br>><br>> ColorMapper1.SetLookupTable(table1);<br>
><br>> <br>><br>> “table is the Lookuptable applied on first file and table1 is the lookup<br>> table applied on second file”.<br>><br>> <br>><br>> After setting the lookuptable I have created instance of vtkImage blend.<br>
><br>> <br>><br>> vtkImageBlend blend = new vtkImageBlend();<br>><br>> blend.setOpacity(0,0);<br>><br>> blend.setOpacity(1,0);<br>><br>> blend.AddInputConnection(ColorMapper.GetOutputPort);<br>
><br>> blend.AddInputConnection(ColorMapper1.GetOutputPort);<br>><br>> <br>><br>> I have later given the output of blend to the Input Connection of Viewer.<br>><br>> Viewer.SetInputConnection(blend.GetOutputPort());<br>
><br>> <br>><br>> But the problem is the opacity results are coming incorrect.<br>><br>> <br>><br>> If the opacity of first file is 0 and the opacity of second file is also 0<br>> then no output should be displayed but the output is getting displayed with<br>
> color of first LUT i.e Green.<br>><br>> If the opacities are 0.5 and 0.5(0.5 opacity for both the files) then the<br>> fused color (dark green ) is getting displayed. The same color is getting<br>> displayed at opacities 0 and 0.5(0 for first file and 0.5 for second).The<br>
> same thing is happening with opacities 1 and 0.5(1 for first file and 0.5<br>> for second).<br>><br>> <br>><br>> Could anyone please explain how this Opacity function is working and how to<br>> blend two different files with different color tables.<br>
><br>> <br>><br>> <br>><br>> <br>><br>> Regards<br>><br>> Anupriya Sharma<br>><br>> <br>><br>><br>> ________________________________<br>> Subject to local law, communications with Accenture and its affiliates<br>
> including telephone calls and emails (including content), may be monitored<br>> by our systems for the purposes of security and the assessment of internal<br>> compliance with Accenture policy.<br>> ______________________________________________________________________________________<br>
><br>> <a href="http://www.accenture.com">www.accenture.com</a><br>><br>> _______________________________________________<br>> Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>><br>> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>><br>> Please keep messages on-topic and check the VTK FAQ at:<br>> <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>> Follow this link to subscribe/unsubscribe:<br>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>><br>