CustusX  2021.04.21-dev+develop.337f9
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 
28 namespace cx
29 {
30 typedef std::map<QString, class Landmark> LandmarkMap;
31 typedef boost::shared_ptr<class RegistrationManager> RegistrationManagerPtr;
32 typedef boost::shared_ptr<class LandmarkListener> LandmarkListenerPtr;
33 
44 class org_custusx_registration_method_landmark_EXPORT LandmarkRegistrationWidget: public RegistrationBaseWidget
45 {
46 Q_OBJECT
47 
48 public:
49  LandmarkRegistrationWidget(RegServicesPtr services, QWidget* parent, QString objectName,
50  QString windowTitle, bool showAccuracy = true);
51  virtual ~LandmarkRegistrationWidget();
52 
53 protected slots:
54  virtual void cellClickedSlot(int row, int column);
55 
56  void cellChangedSlot(int row, int column);
57  void landmarkUpdatedSlot();
58  void updateAverageAccuracyLabel();
59 
60 protected:
61  virtual void showEvent(QShowEvent* event);
62  virtual void hideEvent(QHideEvent* event);
63  virtual void prePaintEvent();
64  virtual LandmarkMap getTargetLandmarks() const = 0;
65  virtual void performRegistration() = 0;
66  virtual Transform3D getTargetTransform() const = 0;
67  virtual void setTargetLandmark(QString uid, Vector3D p_target) = 0;
68  virtual QString getTargetName() const = 0;
69  void setManualToolPosition(Vector3D p_r);
70  QString getNextLandmark();
71  void activateLandmark(QString uid);
72 
73  std::vector<Landmark> getAllLandmarks() const;
74  QString getLandmarkName(QString uid);
75  double getAccuracy(QString uid);
76  double getAverageAccuracy();
77 
78  //gui
79  QVBoxLayout* mVerticalLayout;
80  QTableWidget* mLandmarkTableWidget;
82 
83  //data
84  QString mActiveLandmark;
85  LandmarkListenerPtr mLandmarkListener;
87 
88 private:
90  bool isAverageAccuracyValid();
91  double getAverageAccuracy(int &numActiveLandmarks);
92 
93 };
94 
98 }//namespace cx
99 
100 
101 #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 surrently selected landmark.
QTableWidget * mLandmarkTableWidget
the table widget presenting the landmarks
Namespace for all CustusX production code.