Fraxinus  22.04-rc5
An IGT application
cxLandmarkRegistrationWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXLANDMARKREGISTRATIONWIDGET_H_
12 #define CXLANDMARKREGISTRATIONWIDGET_H_
13 
14 #include "org_custusx_registration_method_landmarkExport.h"
15 
16 #include <map>
17 #include "cxTransform3D.h"
19 
20 
21 class QVBoxLayout;
22 class QComboBox;
23 class QTableWidget;
24 class QPushButton;
25 class QLabel;
26 class QSlider;
27 class QTableWidgetItem;
28 
29 namespace cx
30 {
31 typedef std::map<QString, class Landmark> LandmarkMap;
32 typedef boost::shared_ptr<class RegistrationManager> RegistrationManagerPtr;
33 typedef boost::shared_ptr<class LandmarkListener> LandmarkListenerPtr;
34 
45 class org_custusx_registration_method_landmark_EXPORT LandmarkRegistrationWidget: public RegistrationBaseWidget
46 {
47  Q_OBJECT
48 
49 public:
50  LandmarkRegistrationWidget(RegServicesPtr services, QWidget* parent, QString objectName,
51  QString windowTitle, bool showAccuracy = true);
52  virtual ~LandmarkRegistrationWidget();
53 
54 protected slots:
55  virtual void cellClickedSlot(int row, int column);
56 
57  void cellChangedSlot(int row, int column);
58  void landmarkUpdatedSlot();
59  void updateAverageAccuracyLabel();
60  void mouseClickSampleStateChanged();
61  virtual void pointSampled(Vector3D p_r){};
62 
63 protected:
64  virtual void showEvent(QShowEvent* event);
65  virtual void hideEvent(QHideEvent* event);
66  virtual void prePaintEvent();
67  virtual LandmarkMap getTargetLandmarks() const = 0;
68  virtual void performRegistration() = 0;
69  virtual Transform3D getTargetTransform() const = 0;
70  virtual void setTargetLandmark(QString uid, Vector3D p_target) = 0;
71  virtual QString getTargetName() const = 0;
72  void setManualToolPosition(Vector3D p_r);
73  QString getNextLandmark();
74  void activateLandmark(QString uid);
75  void selectFirstLandmarkIfUnselected();
76 
77  std::vector<Landmark> getAllLandmarks() const;
78  QString getLandmarkName(QString uid);
79  double getAccuracy(QString uid);
80  double getAverageAccuracy();
81  QTableWidgetItem * getLandmarkTableItem();
82 
83 
84  //gui
85  QVBoxLayout* mVerticalLayout;
86  QTableWidget* mLandmarkTableWidget;
88  QCheckBox* mMouseClickSample;
89 
90  //data
91  QString mActiveLandmark;
92  LandmarkListenerPtr mLandmarkListener;
94 
95 private:
97  bool isAverageAccuracyValid();
98  double getAverageAccuracy(int &numActiveLandmarks);
99 
100 };
101 
105 }//namespace cx
106 
107 
108 #endif /* CXLANDMARKREGISTRATIONWIDGET_H_ */
boost::shared_ptr< class LandmarkListener > LandmarkListenerPtr
boost::shared_ptr< class RegistrationManager > RegistrationManagerPtr
QLabel * mAvarageAccuracyLabel
label showing the average accuracy
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
QVBoxLayout * mVerticalLayout
vertical layout is used
boost::shared_ptr< class RegServices > RegServicesPtr
Definition: cxRegServices.h:20
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
std::map< QString, class Landmark > LandmarkMap
QString mActiveLandmark
uid of currently selected landmark.
QTableWidget * mLandmarkTableWidget
the table widget presenting the landmarks
Namespace for all CustusX production code.