Fraxinus  22.09
An IGT application
cxLapFrameToolCalibrationWidget.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 
12 #ifndef CXLAPFRAMETOOLCALIBRATIONWIDGET_H_
13 #define CXLAPFRAMETOOLCALIBRATIONWIDGET_H_
14 
15 #include "org_custusx_calibration_Export.h"
16 
17 #include "cxTransform3D.h"
18 #include "cxVector3D.h"
19 #include "cxBaseWidget.h"
21 #include "cxForwardDeclarations.h"
22 #include "cxDoubleProperty.h"
23 
24 class QPushButton;
25 class QGroupBox;
26 class QLineEdit;
27 
28 namespace cx
29 {
30 typedef boost::shared_ptr<class VisServices> VisServicesPtr;
31 typedef boost::shared_ptr<class StringPropertySelectTool> StringPropertySelectToolPtr;
32 
46 class org_custusx_calibration_EXPORT LapFrameToolCalibrationWidget : public BaseWidget
47 {
48  Q_OBJECT
49 
50 public:
51  LapFrameToolCalibrationWidget(VisServicesPtr services, QWidget* parent);
53 
54 private slots:
55  void calibrateSlot();
56  void testCalibrationSlot();
57  void toolSelectedSlot();
58  void trackingStartedSlot();
59 
60 private:
61  VisServicesPtr mServices;
62  QPushButton* mCalibrateButton;
63  QLabel* mReferencePointLabel;
64  QPushButton* mTestButton;
65  QLabel* mCalibrationLabel;
66  QLabel* mDeltaLabel;
67  StringPropertySelectToolPtr mCalibRefTool;
68  StringPropertySelectToolPtr mCalibratingTool;
69  DoublePropertyPtr mCameraAngleAdapter;
70 };
71 
81 class org_custusx_calibration_EXPORT LapFrameToolCalibrationCalculator
82 {
83 public:
84  LapFrameToolCalibrationCalculator(ToolPtr tool, ToolPtr calRef, double cameraAngle);
86 
87  Vector3D get_delta_ref();
88  Transform3D get_calibration_sMt();
89 
90 private:
91  void useOnlyRotationalPart(Transform3D* transform);
92  ToolPtr mTool;
93  ToolPtr mCalibrationRef;
94  Transform3D m_sMpr;
95  Transform3D m_qMpr;
96  Transform3D m_qMcr;
97  double mCameraAngle;
98 };
102 }
103 
104 #endif /* CXLAPFRAMETOOLCALIBRATIONWIDGET_H_ */
DoubleBoundingBox3D transform(const Transform3D &m, const DoubleBoundingBox3D &bb)
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class StringPropertySelectTool > StringPropertySelectToolPtr
boost::shared_ptr< class DoubleProperty > DoublePropertyPtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr