MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkIGTNavigationToolCalibration.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13
14#ifndef QmitkIGTNavigationToolCalibration_h
15#define QmitkIGTNavigationToolCalibration_h
16
17#include <berryISelectionListener.h>
18
19#include <QmitkAbstractView.h>
20
21#include <mitkNavigationData.h>
22
24
25
26#include "ui_QmitkIGTNavigationToolCalibrationControls.h"
27
29
30//QT headers
31#include <QTimer>
32
33
41class QmitkIGTNavigationToolCalibration : public QmitkAbstractView
42{
43 // this is needed for all Qt objects that should have a Qt meta-object
44 // (everything that derives from QObject and wants to have signal/slots)
45 Q_OBJECT
46
47public:
48
50
52
53 static const std::string VIEW_ID;
54
55 void CreateQtPartControl(QWidget *parent) override;
56
57 protected slots:
58
59
60 void OnAddPivotPose();
61 void OnComputePivot();
63 void SetToolToCalibrate();
66 void AddLandmark();
67 void SaveCalibratedTool();
68 void OnToolCalibrationMethodChanged(int index);
73 void OnGetPositions();
76 void OnManualEditToolTipFinished(mitk::AffineTransform3D::Pointer toolTip);
77
78protected:
79
80 void SetFocus() override;
81
83
85
86 Ui::IGTNavigationToolCalibrationControls m_Controls;
87
88 //some general members
89 mitk::NavigationTool::Pointer m_ToolToCalibrate; //<<< tool that will be calibrated
90 int m_IDToolToCalibrate; //<<< id of tool that will be calibrated (of the navigation data source)
91 mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfToolToCalibrate; //<<< navigation data source of the tool that will be calibrated
92 mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfCalibrationPointer; //<<< navigation data source of the calibration pointer
93 mitk::DataNode::Pointer m_ToolSurfaceInToolCoordinatesDataNode; //<<< holds the tool surface in tool coordinates (for preview purposes)
94 int m_IDCalibrationPointer; //<<< id of the calibration pointer (of the corresponding navigation data source)
95 QTimer* m_TrackingTimer; //<<< tracking timer that updates the status widgets
96 void ApplyToolTipTransform(mitk::NavigationData::Pointer ToolTipTransformInToolCoordinates, std::string message = "Tool was updated with the calibrated tool tip!"); //<<< applies the given tool tip transform to the tool to calibrate
97 bool CheckInitialization(bool CalibrationPointerRequired = true); //<<< checks if the tool to calibrate and (if required) the calibration pointer is initialized. Displays a warning and returns false if not.
98 mitk::NavigationData::Pointer m_ComputedToolTipTransformation; //<<< holds the new tooltip transformation after it was computed to write it into the tool later
99
100 // members and helper methods for pivot tool calibration
101 std::vector<mitk::NavigationData::Pointer> m_PivotPoses;
102 void AddPivotPose();
103 void ClearOldPivot();
104 void UpdatePivotCount();
107
108 // members and helper methods for manual tool calibration
111
112 // members and helper methods for single reference tool calibration
114 std::vector< mitk::Point3D > m_LoggedNavigationDataOffsets;
115 std::vector< mitk::NavigationData::Pointer > m_LoggedNavigationDataDifferences;
119 mitk::Point3D m_ResultOffsetVector;
120
121 // members and helper methods for tool tip preview
122 mitk::DataNode::Pointer m_ToolTipPointPreview; //<<< Data node of the tool tip preview
123 void ShowToolTipPreview(mitk::NavigationData::Pointer ToolTipInTrackingCoordinates); //<<< Adds a preview of the tool tip into the data storage
124 void RemoveToolTipPreview(); //<<< Removes the preview
125
126 // members for the tool landmark calibration
127 mitk::PointSet::Pointer m_CalibrationLandmarks;
128 mitk::DataNode::Pointer m_CalibrationLandmarksNode;
129 mitk::PointSet::Pointer m_RegistrationLandmarks;
130 mitk::DataNode::Pointer m_RegistrationLandmarksNode;
131
132 //members and helper methods for tool axis calibration
133 mitk::Vector3D m_CalibratedToolAxis;
134 mitk::NavigationData::Pointer m_AxisCalibration_ToolToCalibrate;
135 mitk::NavigationData::Pointer m_AxisCalibration_NavDataCalibratingTool;
136
137};
138
139#endif
mitk::NavigationData::Pointer m_ComputedToolTipTransformation
void ApplyToolTipTransform(mitk::NavigationData::Pointer ToolTipTransformInToolCoordinates, std::string message="Tool was updated with the calibrated tool tip!")
Ui::IGTNavigationToolCalibrationControls m_Controls
void OnManualEditToolTipFinished(mitk::AffineTransform3D::Pointer toolTip)
void ShowToolTipPreview(mitk::NavigationData::Pointer ToolTipInTrackingCoordinates)
std::vector< mitk::NavigationData::Pointer > m_LoggedNavigationDataDifferences
std::vector< mitk::NavigationData::Pointer > m_PivotPoses
std::vector< mitk::Point3D > m_LoggedNavigationDataOffsets
bool CheckInitialization(bool CalibrationPointerRequired=true)
mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfCalibrationPointer
mitk::NavigationData::Pointer m_AxisCalibration_ToolToCalibrate
QmitkInteractiveTransformationWidget * m_ToolTransformationWidget
mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfToolToCalibrate
mitk::NavigationData::Pointer m_AxisCalibration_NavDataCalibratingTool
An object of this class offers an UI to create a widget to access the advanced tool creation options.