NorMIT-nav  2023.01.05-dev+develop.0da12
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;
94 
95 private:
97  bool isAverageAccuracyValid();
98  double getAverageAccuracy(int &numActiveLandmarks);
99 
100 };
101 
105 }//namespace cx
106 
107 
108 #endif /* CXLANDMARKREGISTRATIONWIDGET_H_ */
cx::LandmarkRegistrationWidget
Definition: cxLandmarkRegistrationWidget.h:45
cx::LandmarkRegistrationWidget::mLandmarkListener
LandmarkListenerPtr mLandmarkListener
Definition: cxLandmarkRegistrationWidget.h:92
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::LandmarkMap
std::map< QString, class Landmark > LandmarkMap
Definition: cxLandmarkRegistrationWidget.h:31
cx::RegistrationBaseWidget
Definition: cxRegistrationBaseWidget.h:28
cx::LandmarkRegistrationWidget::mMouseClickSample
QCheckBox * mMouseClickSample
Definition: cxLandmarkRegistrationWidget.h:88
cx::LandmarkRegistrationWidget::mLandmarkTableWidget
QTableWidget * mLandmarkTableWidget
the table widget presenting the landmarks
Definition: cxLandmarkRegistrationWidget.h:86
cx::LandmarkRegistrationWidget::pointSampled
virtual void pointSampled(Vector3D p_r)
Definition: cxLandmarkRegistrationWidget.h:61
cx::LandmarkRegistrationWidget::mAvarageAccuracyLabel
QLabel * mAvarageAccuracyLabel
label showing the average accuracy
Definition: cxLandmarkRegistrationWidget.h:87
cx::LandmarkRegistrationWidget::mActiveLandmark
QString mActiveLandmark
uid of currently selected landmark.
Definition: cxLandmarkRegistrationWidget.h:91
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::LandmarkRegistrationWidget::mVerticalLayout
QVBoxLayout * mVerticalLayout
vertical layout is used
Definition: cxLandmarkRegistrationWidget.h:85
cxRegistrationBaseWidget.h
cx::RegServicesPtr
boost::shared_ptr< class RegServices > RegServicesPtr
Definition: cxRegServices.h:20
cx::RegistrationManagerPtr
boost::shared_ptr< class RegistrationManager > RegistrationManagerPtr
Definition: cxLandmarkRegistrationWidget.h:32
cx::LandmarkRegistrationWidget::mShowAccuracy
bool mShowAccuracy
Definition: cxLandmarkRegistrationWidget.h:93
cxTransform3D.h
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cx::LandmarkListenerPtr
boost::shared_ptr< class LandmarkListener > LandmarkListenerPtr
Definition: cxLandmarkListener.h:24