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