[vtkusers] QVTKWidget and VtkImageViewer issue

Peter von Niederhaeusern pvonnied at gmail.com
Mon Feb 22 08:34:26 EST 2010


Hi all,

I googled around to find a solution for the following issue but without success:
In a slot of my MainGui class I create a QVTKWidget and a VtkImageViewer.
The image viewer receives a volume from an itk to vtk filter (to read
in some DICOM data).

Upon signaling the slot, the QVTKWidget gets painted but NOT its content
(the volume from the image viewer). The widget just hangs there with a
stale background
(when dragged around)...

================
void MainWindow::OnButtonPressed( void )
{
...
this->mQvtkWidget = new QVTKWidget();
this->mQvtkWidget->setWindowTitle( "Test" );

this->mVtkImageViewer = vtkImageViewer::New();
this->mVtkImageViewer->SetInput( obj.VtkUnsigned8BitVolume );

this->mQvtkWidget->SetRenderWindow( this->mVtkImageViewer->GetRenderWindow() );
this->mVtkImageViewer->SetupInteractor(
this->mQvtkWidget->GetRenderWindow()->GetInteractor() );

this->mQvtkWidget->update();
his->mQvtkWidget->show();
...
}
================

Frameworks: Qt 4.5.2 (2009.03), vtk-5.4.2, gcc (GCC) 3.4.5
(mingw-vista special r3), Itk 3.16
Platform: Windows Vista (64bit)

I know that this is a rather often occuring issue, but I'm unable to
find a solution/workaround.

Thank you for your help.

Best regards,
Peter



More information about the vtkusers mailing list