<div dir="ltr"><br><div>Dear Vtk users,</div><div><br></div><div>I am using vtkimageblend class for multiple volumes and want to change opacity of volumes. Here I put the small code for single volume for simplicity. </div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">ImageViewer is working fine but opacity is not working.</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">Any body have an idea that what I'm doing wrong here ?</font></pre></pre></div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">vtkSmartPointer</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(128,0,128)">vtkImageBlend</span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">blend</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">vtkSmartPointer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><</span><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">vtkImageBlend</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">>::New();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">blend</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetInputData</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(0,0,0)">reader</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">GetOutput</span><span style="color:rgb(0,0,0)">());</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">blend</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetOpacity</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0.3</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">vtkSmartPointer</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(128,0,128)">vtkImageViewer2</span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">imgViewer = </span><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">vtkSmartPointer</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><</span><span style="font-family:arial,sans-serif;color:rgb(128,0,128)">vtkImageViewer2</span><span style="font-family:arial,sans-serif;color:rgb(0,0,0)">>::New();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">imgViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">SetInputData</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">blend</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">GetOutput</span><span style="color:rgb(0,0,0)">());</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">imgViewer</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">UpdateDisplayExtent</span><span style="color:rgb(0,0,0)">();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">--</pre><pre style="margin-top:0px;margin-bottom:0px">Regards,</pre><pre style="margin-top:0px;margin-bottom:0px">Muhammad Jawad</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre></pre></div></div>