[vtkusers] QVTKWidget and VtkImageViewer issue

KS Jothybasu jothybasu at gmail.com
Mon Feb 22 10:03:31 EST 2010


Have you tried ImageViewer.Render()?

And, you should set the windowtitle after Render()/Show(), I think....

Jothy



On Mon, Feb 22, 2010 at 1:34 PM, Peter von Niederhaeusern <
pvonnied at gmail.com> wrote:

> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100222/4b9f36c0/attachment.htm>


More information about the vtkusers mailing list