[vtkusers] vtkImageViewer2 trouble with QVTKWidget
Antonin Perrot-Audet
antonin07130 at gmail.com
Fri Apr 30 20:14:43 EDT 2010
Hello,
I have some trouble using the QVTKWidget with a vtkImageViewer2 :
I am able to render an image in the QVTKWidget, but if I try to setup an
interactor, the application freezes :
--------
vtkImgViewer2->SetupInteractor(this->qvtkWidget_a->GetRenderWindow()->GetInteractor());
--------
I have seen several mails about using vtkImageViewer2 and QT, even from
Luis, but there seems to be no solution yet ?
Should I use a vtkImageViewer instead ?
Here is a short version of my code : vtkImage is a pointer towards a
vtkImageData, given as an argument
--------
vtkSmartPointer<vtkImageViewer2> vtkImgViewer2 =
vtkSmartPointer<vtkImageViewer2>::New();
vtkImgViewer2->SetInput(vtkImage);
vtkImgViewer2->Render();
// makes the program crash :
//vtkImgViewer2->SetupInteractor(this->qvtkWidget_a->GetRenderWindow()->GetInteractor());
this->qvtkWidget_a->SetRenderWindow(vtkImgViewer2->GetRenderWindow());
--------
So that I now have the weird behavior that I can display an image and
interact with it as a 3D object ....
The vtkImageData seems to be provided just fine as I can display the
image with the wrong interactor, so it doesn't seem to be a pipeline
problem ?
I also tried declaring an interactor of vtkImageInteractorStyle, and
attributing it to both the vtkImageViewer2 and the QVTKWidget, with the
same results.
*any idea or even experience using these tools would be greatly
appreciated,*
Thanks,
Antonin
--
Antonin Perrot-Audet
Electrical Engineering& Computer Sciences, INSA Lyon
M2 GEGP Signal& Image Processing, INSA Lyon, UCBL, Centrale Lyon
More information about the vtkusers
mailing list