Hi Michael,<br><br>Thank'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"><<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>></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->Delete();<br>
<br>
or use a vtkSmartPointer to instantiate the vtkImageViewer and you don't need to call the Delete() method:<br>
<br>
vtkSmartPointer<vtkImageViewer> image_view = vtkSmartPointer<vtkImageViewer>::New();<br>
<br>
<br>
_________________________________________________________<br>
Mike Jackson <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer 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>
ImageType2D::Pointer img = myImage->getImage2DFrom3D(horizontalScrollBar->value());<br>
<br>
vtkImageViewer* image_view = vtkImageViewer::New();<br>
image_view->SetInput(myImage->convertITKtoVTK(img));<br>
<br>
vtkWidget->SetRenderWindow(image_view->GetRenderWindow());<br>
<br>
image_view->SetColorLevel(138.5);<br>
image_view->SetColorWindow(233);<br>
<br>
vtkWidget->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'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't work.<br>
<br>
Is this really a "double buffering" 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>