38 #ifndef __us2DSceneWidget_h_
39 #define __us2DSceneWidget_h_
42 #include <visp3/ustk_core/usConfig.h>
44 #ifdef USTK_HAVE_VTK_QT
46 #include <visp3/core/vpException.h>
47 #include <visp3/core/vpHomogeneousMatrix.h>
49 #include <visp3/ustk_core/us.h>
50 #include <visp3/ustk_gui/usVTKConverter.h>
51 #include <visp3/ustk_gui/usViewerWidget.h>
54 #include <vtkImageActor.h>
55 #include <vtkImageData.h>
56 #include <vtkImageMapToColors.h>
57 #include <vtkImageReslice.h>
58 #include <vtkImageResliceMapper.h>
59 #include <vtkImageSlice.h>
60 #include <vtkInteractorStyleImage.h>
61 #include <vtkLookupTable.h>
63 #include <vtkRenderWindow.h>
64 #include <vtkRenderer.h>
65 #include <vtkSmartPointer.h>
67 #include <vtkAnnotatedCubeActor.h>
68 #include <vtkCellArray.h>
69 #include <vtkCommand.h>
70 #include <vtkCoordinate.h>
71 #include <vtkImageActor.h>
72 #include <vtkImageData.h>
73 #include <vtkImageMapToColors.h>
74 #include <vtkImageMapper3D.h>
75 #include <vtkImageReader2.h>
76 #include <vtkImageReslice.h>
77 #include <vtkInformation.h>
78 #include <vtkInteractorStyleImage.h>
80 #include <vtkLookupTable.h>
81 #include <vtkMatrix4x4.h>
82 #include <vtkMetaImageReader.h>
83 #include <vtkPNGWriter.h>
84 #include <vtkPointPicker.h>
85 #include <vtkPoints.h>
86 #include <vtkPolyData.h>
87 #include <vtkPolyDataMapper.h>
88 #include <vtkPolygon.h>
89 #include <vtkPropPicker.h>
90 #include <vtkProperty.h>
91 #include <vtkRenderWindow.h>
92 #include <vtkRenderWindowInteractor.h>
93 #include <vtkRenderer.h>
94 #include <vtkResliceCursor.h>
95 #include <vtkResliceCursorWidget.h>
96 #include <vtkSTLReader.h>
97 #include <vtkSmartPointer.h>
98 #include <vtkStreamingDemandDrivenPipeline.h>
101 #if defined(USTK_HAVE_VTK_QT4)
102 #include <QApplication>
103 #include <QtCore/QPoint>
104 #include <QtGui/QGridLayout>
105 #include <QtGui/QMainWindow>
106 #include <QtGui/QPainter>
107 #include <QtGui/QPushButton>
108 #include <QtGui/QWheelEvent>
109 #elif defined USTK_HAVE_VTK_QT5
110 #include <QApplication>
111 #include <QWheelEvent>
112 #include <QtWidgets/QGridLayout>
113 #include <QtWidgets/QMainWindow>
114 #include <QtWidgets/QPushButton>
117 #if USTK_HAVE_VTK_VERSION < 0x090000
118 #include <QVTKWidget.h>
120 #include <QVTKOpenGLStereoWidget.h>
134 us2DSceneWidget(QWidget *parent = NULL, Qt::WindowFlags f = Qt::WindowFlags());
137 void drawLine(
double u1,
double v1,
double w1,
double u2,
double v2,
double w2);
139 void getClick(vpColVector &vec);
143 vtkImageData *getImageData();
145 vtkMatrix4x4 *getResliceMatrix();
152 void keyPressEvent(QKeyEvent *event);
153 void keyReleaseEvent(QKeyEvent *event);
155 void mouseMoveEvent(QMouseEvent *event);
156 void mousePressEvent(QMouseEvent *event);
162 void setColor(
double r,
double g,
double b);
165 void setImageData(vtkImageData *imageData);
168 void setResliceMatrix(vtkMatrix4x4 *matrix);
170 void setPolyDataPlaneContour(vtkPolyData *polyData);
171 void setPolyDataMeshContour(vtkPolyData *polyData);
174 void wheelEvent(QWheelEvent *event);
177 void updateImageData(vtkImageData *imageData);
179 void changeMatrix(vpHomogeneousMatrix matrix);
190 vtkImageData *m_imageData;
193 vtkMatrix4x4 *m_resliceMatrix;
196 vtkImageReslice *m_reslice;
199 vtkLookupTable *m_table;
202 vtkImageMapToColors *m_color;
205 vtkImageActor *m_actor;
208 vtkRenderer *m_renderer;
209 vtkRenderer *m_polyDataRenderer;
212 vtkPolyData *m_polydataPlaneContour;
213 vtkPolyDataMapper *m_polyDataPlaneContourMapper;
214 vtkActor *m_polydataPlaneContourActor;
217 vtkPolyData *m_polydataMeshContour;
218 vtkPolyDataMapper *m_polyDataMeshContourMapper;
219 vtkActor *m_polydataMeshContourActor;
222 vtkPropPicker *m_propPicker;
232 int m_lastmouserPosX;
233 int m_lastmouserPosY;
237 vpColVector m_pickedVoxel;