<div dir="ltr">I realized my code for blending DICOM images is correct and the problem was with the visualization; so I just needed to update the QVTKWidget by adding myQVTKWidgetObj->Update() to my code.<div><br></div>
<div> </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 18, 2014 at 6:36 PM, Sam Raby <span dir="ltr"><<a href="mailto:rabysam28@gmail.com" target="_blank">rabysam28@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I guess I would like to know if there is any trivial error in my code. I have seen usage of vtkBlendImage for 2D images [1]. but what I have done in my code is that I am blending the whole 3D volume of the two DICOM series, as I did not find any other way. </div>
<div><br><div>The code does not have compilation error, but the result seems sort of random; sometimes it jumps to another slice when I change the blending ratio, while I have already verified that image dimension, image spacing and image origin of both volumes are equal.</div>
<div><br></div><div><div>[1] <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/CombineImages" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/CombineImages</a><br></div></div></div></div><div class="HOEnZb">
<div class="h5"><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Tue, Feb 18, 2014 at 6:21 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr">Does not work, does not help.</p>
<div class="gmail_quote"><div><div>On Feb 18, 2014 6:52 PM, "Sam Raby" <<a href="mailto:rabysam28@gmail.com" target="_blank">rabysam28@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>
<div dir="ltr">Hello,<div><br></div><div>I am using vtkBlendImage to overlay two DICOM images. The two images are already perfectly co-registered. </div><div><br></div><div>To overlay them, I am using the following code, but it does not work well. Would you advice if there is any problem with the code? Thanks!<div>
<br></div><div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>reader1<span>-></span><span>SetDirectoryName</span><span>(</span><span style="color:rgb(0,128,0)">"/home/dicomDIR1"</span><span>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>reader1<span>-></span><span style="font-style:italic">Update</span><span>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>reader2<span>-></span><span>SetDirectoryName</span><span>(</span><span style="color:rgb(0,128,0)">"/home/dicomDIR2"</span><span>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>reader2<span>-></span><span style="font-style:italic">Update</span><span>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>blend<span>-></span><span style="font-style:italic">AddInputConnection</span><span>(</span>reader1<span>-></span><span>GetOutputPort</span><span>());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>blend<span>-></span><span style="font-style:italic">AddInputConnection</span><span>(</span>reader2<span>-></span><span>GetOutputPort</span><span>());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>blend<span>-></span><span>SetOpacity</span><span>(</span><span style="color:rgb(0,0,128)">0</span><span>,0</span><span>.5</span><span>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>blend<span>-></span><span>SetOpacity</span><span>(</span><span style="color:rgb(0,0,128)">1</span><span>,</span><font color="#000080">0.5</font><span>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>imageViewer<span>-></span><span style="font-style:italic">SetInputConnection</span><span>(</span>blend<span>-></span><span>GetOutputPort</span><span>());</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"> imageViewer<span>-></span><span style="font-style:italic">SetSlice</span><span>(</span><span>oneSlice</span><span>);</span></pre>
</pre><pre style="margin-top:0px;margin-bottom:0px"><span><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre></pre></pre></pre></pre><pre style="margin-top:0px;margin-bottom:0px"></pre></div></div></div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">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" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>