UsTK : Ultrasound ToolKit  version 2.0.1 under development (2024-05-21)
usResliceMatrixViewer.h
1 /****************************************************************************
2  *
3  * This file is part of the ustk software.
4  * Copyright (C) 2016 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ustk with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * This software was developed at:
17  * Inria Rennes - Bretagne Atlantique
18  * Campus Universitaire de Beaulieu
19  * 35042 Rennes Cedex
20  * France
21  *
22  * If you have questions regarding the use of this file, please contact
23  * Inria at ustk@inria.fr
24  *
25  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27  *
28  * Authors:
29  * Marc Pouliquen
30  *
31  *****************************************************************************/
32 
38 #ifndef __usResliceMatrixViewer_h_
39 #define __usResliceMatrixViewer_h_
40 
41 // VISP includes
42 #include <visp3/ustk_core/usConfig.h>
43 
44 #ifdef USTK_HAVE_VTK_QT
45 
46 // USTK includes
47 
48 #include <visp3/ustk_core/usImageIo.h>
49 #include <visp3/ustk_gui/us2DSceneWidget.h>
50 #include <visp3/ustk_gui/us3DSceneWidget.h>
51 
52 // VTK includes
53 #include <vtkDistanceWidget.h>
54 #include <vtkImageMapper3D.h>
55 #include <vtkImagePlaneWidget.h>
56 #include <vtkPlane.h>
57 #include <vtkResliceImageViewer.h>
58 #include <vtkResliceImageViewerMeasurements.h>
59 #include <vtkSmartPointer.h>
60 
61 // Qt includes
62 #if defined(USTK_HAVE_VTK_QT4)
63 #include <QtGui/QApplication>
64 #include <QtGui/QGridLayout>
65 #include <QtGui/QMainWindow>
66 #include <QtGui/QPushButton>
67 #elif defined(USTK_HAVE_VTK_QT4) // QT 5 ?
68 #include <QtWidgets/QApplication>
69 #include <QtWidgets/QGridLayout>
70 #include <QtWidgets/QMainWindow>
71 #include <QtWidgets/QPushButton>
72 #endif
73 
80 class VISP_EXPORT usResliceMatrixViewer : public QMainWindow
81 {
82  Q_OBJECT
83 public:
84  // Constructor/Destructor
85  usResliceMatrixViewer(std::string imageFileName);
87 
88  void resizeEvent(QResizeEvent *event);
89 
90 public slots:
91 
92  virtual void ResetViews();
93  virtual void Render();
94  virtual void slotExit();
95 
96  void getView1Slice();
97  void openPostScan3D();
98 
99 private:
100  void setupUi();
101 
102  QAction *actionOpenFile;
103  QAction *actionExit;
104  QAction *actionPrint;
105  QAction *actionHelp;
106  QAction *actionSave;
107  QWidget *centralwidget;
108  QWidget *gridLayoutWidget;
109  QGridLayout *gridLayout_2;
110  us2DSceneWidget *view1;
111  us2DSceneWidget *view4;
112  us2DSceneWidget *view3;
113  us3DSceneWidget *view2;
114 
115  QPushButton *resetButton;
116  QPushButton *openImageButton;
117  QPushButton *saveView1Button;
118  QPushButton *saveView4Button;
119  QPushButton *saveView3Button;
120 
121  // VTK planes
122  vtkPlane *plane1;
123  vtkPlane *plane2;
124  vtkPlane *plane3;
125 
126  // transformation
127  vtkMatrix4x4 *vtkMatrix1;
128  vtkMatrix4x4 *vtkMatrix2;
129  vtkMatrix4x4 *vtkMatrix3;
130 
131  // image
132  usImagePostScan3D<unsigned char> postScanImage;
133  vtkSmartPointer<vtkImageData> vtkImage;
134 };
135 #endif
136 #endif // __usResliceMatrixViewer_h_
Class used to render a 2D slice of a vtkImageData in a vtk scene in a QWidget (based on QVTKWidget)
Class used to render a 3D vtk scene containing a vtkImageData in a QWidget (based on QVTKWidget).
Graphical main window containing 4 vtk views.