Hi Michael,<br><br>Thank&#39;s for pointing this out, but it does not solve the flicker problem.<br><br>Does anybody knows how to do it?<br><br><div class="gmail_quote">On Sat, Oct 25, 2008 at 10:28 AM, Michael Jackson <span dir="ltr">&lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Not sure about the flickering but if that is truly your code then it has a memory leak.<div class="Ih2E3d">
<br>
<br>
vtkImageViewer* image_view = vtkImageViewer::New();<br>
<br></div>
Creates a pointer but the pointer is never destroyed. You need a line like:<br>
<br>
image_view-&gt;Delete();<br>
<br>
or use a vtkSmartPointer to instantiate the vtkImageViewer and you don&#39;t need to call the Delete() method:<br>
<br>
vtkSmartPointer&lt;vtkImageViewer&gt; image_view = vtkSmartPointer&lt;vtkImageViewer&gt;::New();<br>
<br>
<br>
_________________________________________________________<br>
Mike Jackson &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dayton, Ohio<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
<br>
On Oct 24, 2008, at 11:08 PM, Luis Roberto P. Paula wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
Hi All,<br>
<br>
I have developed a GUI with Qt and I am using the QVTKWidget to display a 2D image.<br>
<br>
This 2D image cames from a 3D image. I have a slider to control what is the slice to be displayed.<br>
<br>
The problem is that I am getting a flickering effect every time the image is changed.<br>
<br>
Here is a piece of code of what I am doing:<br>
<br>
void MyGui::moveBar() {<br>
 &nbsp; ImageType2D::Pointer img = myImage-&gt;getImage2DFrom3D(horizontalScrollBar-&gt;value());<br>
<br>
 &nbsp; vtkImageViewer* image_view = vtkImageViewer::New();<br>
 &nbsp; image_view-&gt;SetInput(myImage-&gt;convertITKtoVTK(img));<br>
<br>
 &nbsp; vtkWidget-&gt;SetRenderWindow(image_view-&gt;GetRenderWindow());<br>
<br>
 &nbsp; image_view-&gt;SetColorLevel(138.5);<br>
 &nbsp; image_view-&gt;SetColorWindow(233);<br>
<br>
 &nbsp; vtkWidget-&gt;show();<br>
}<br>
<br>
This method is called every time the slider is moved.<br>
<br>
Does anybody knows how to get rid of this flickering effect?<br>
<br>
I&#39;m using VTK 5.2.0 and Qt4.<br>
<br>
I have already tried to use the QTVTKWidget (a subclass of the QVTKWidget) as suggested here (<a href="http://www.vtk.org/pipermail/vtkusers/2006-November/088194.html" target="_blank">http://www.vtk.org/pipermail/vtkusers/2006-November/088194.html</a>), but it didn&#39;t work.<br>

<br>
Is this really a &quot;double buffering&quot; problem?<br>
<br>
Is Qt a good framework to create GUIs for VTK applications?<br>
<br>
Thanks in advance,<br>
Luis<br></div></div>
_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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>
</blockquote>
<br>
</blockquote></div><br>