[vtkusers] How to restrict vtkGenericOpenGLRenderWindow area to vtkResliceImageViewer render window

ran kor1581 at gmail.com
Tue Dec 11 11:11:43 EST 2018


As part of an application for displaying DICOM images in Qt widget
application in windows 10, I'm using vtkResliceImageViewer, custom
vtkInteractorStyleImage, vtkGenericOpenGLRenderWindow, QVTKOpenGLWidget for
displaying and fitting the images in Qt window. 
I also use vtkPlaneWidget, mriVtkLineWidget2 widgets inside the viewer.
It is working properly, but the problem is While Initially set the
coordinates for mriVtkLineWidget2 and vtkPlaneWidget objects it's correctly
displaying inside the DICOM image displayed area. But when moving the
widgets with mouse interactions, its rendering outside the
vtkResliceImageViewer render area. 
But I need to restrict the widgets render area to DICOM image displayed
area.

I expect the problem is the DICOM image area displaying inside the
vtkResliceImageViewer which DICOM images are displayed but
vtkGenericOpenGLRenderWindow render area is present beyond that, is this
right?
 How can I restrict widgets inside DICOM displaying area? 

My rendering code is something like this
    vtkNew <vtkGenericOpenGLRenderWindow> m_openGlRenWin;
    vtkNew <MyVtkInteractionStyleImage> m_InteractorStyleWin; 
    vtkNew <vtkResliceImageViewer> m_vtkImViewerWin; 
    QScopedPointer <QVTKOpenGLWidget> m_vtkWgtWin;
    vtkNew<vtkPlaneWidget> m_vtkPlaneWid;
    vtkNew <mriVtkLineWidget2> m_Line;

   m_vtkWgtWin->SetRenderWindow(m_openGlRenWin);
   m_vtkImViewerWin->SetRenderWindow(m_openGlRenWin);
   m_vtkImViewerWin->SetupInteractor(m_openGlRenWin->GetInteractor());
   
m_openGlRenWin->GetInteractor()->SetInteractorStyle(m_InteractorStyleWin);
   m_vtkPlaneWid->SetInteractor(m_vtkImViewerWin->GetInteractor());
  m_Line->SetInteractor(m_vtkImViewerWin->GetInteractor());

The code is not full, only included the relevant part,
Please help to set restrict vtkGenericOpenGLRenderWindow render
vtkResliceImageViewer  render area.



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list