[vtkusers] Flickering with QVTKWidget

Luis Roberto P. Paula luisrpp at gmail.com
Fri Oct 24 23:08:31 EDT 2008


Hi All,

I have developed a GUI with Qt and I am using the QVTKWidget to display a 2D
image.

This 2D image cames from a 3D image. I have a slider to control what is the
slice to be displayed.

The problem is that I am getting a flickering effect every time the image is
changed.

Here is a piece of code of what I am doing:

void MyGui::moveBar() {
   ImageType2D::Pointer img =
myImage->getImage2DFrom3D(horizontalScrollBar->value());

   vtkImageViewer* image_view = vtkImageViewer::New();
   image_view->SetInput(myImage->convertITKtoVTK(img));

   vtkWidget->SetRenderWindow(image_view->GetRenderWindow());

   image_view->SetColorLevel(138.5);
   image_view->SetColorWindow(233);

   vtkWidget->show();
}

This method is called every time the slider is moved.

Does anybody knows how to get rid of this flickering effect?

I'm using VTK 5.2.0 and Qt4.

I have already tried to use the QTVTKWidget (a subclass of the QVTKWidget)
as suggested here (
http://www.vtk.org/pipermail/vtkusers/2006-November/088194.html), but it
didn't work.

Is this really a "double buffering" problem?

Is Qt a good framework to create GUIs for VTK applications?

Thanks in advance,
Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081025/f76f6c5e/attachment.htm>


More information about the vtkusers mailing list