MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkIGTTrackingLabView.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 QmitkIGTTrackingLabView_h
15#define QmitkIGTTrackingLabView_h
16
17#include <berryISelectionListener.h>
18
19#include <QmitkAbstractView.h>
20
21#include "ui_QmitkIGTTrackingLabViewControls.h"
22
29#include <mitkSurface.h>
31
32#include <QToolBox>
33#include <QCheckBox>
34#include <QComboBox>
35#include <QPushButton>
36#include <QLabel>
37#include <QSpinBox>
38#include <QTimer>
39
40#include <vtkLandmarkTransform.h>
41#include <vtkSmartPointer.h>
42
50class QmitkIGTTrackingLabView : public QmitkAbstractView
51{
52// this is needed for all Qt objects that should have a Qt meta-object
53// (everything that derives from QObject and wants to have signal/slots)
54Q_OBJECT
55
56public:
57
58static const std::string VIEW_ID;
59
64
69
70void CreateQtPartControl(QWidget *parent) override;
71
72void SetFocus() override;
73
74protected slots:
75
83void UpdateTimer();
84
85//############## Configuration Step #####################
86
91
96
101
102//############## Initial Registration Step ##############
103
108
113
118
119//############## Permanent Registration Step ############
120
124void OnPermanentRegistration(bool on);
125
126//############## Pointset Recording Step ################
127
131void OnPointSetRecording(bool record);
132
133//############## Camera View Step #######################
137void OnVirtualCamera(bool on);
138
139protected:
140
141Ui::QmitkIGTTrackingLabViewControls m_Controls;
149void CreateConnections();
157void DestroyIGTPipeline();
158
159//####################### Members for the IGT pipeline ######################################
160// The IGT pipeline is basically initialized in the method OnSetupNavigation(). Further initialization
161// is done in the methods OnPermanentRegistration(), OnPointSetRecording() and OnVirtualCamera().
162// The pipline is updated in the method UpdateTimer(). When the complete pipeline is active, it is
163// structured as follows:
164// ,-> m_PermanentRegistrationFilter
165// m_Source -> m_Visualizer
166// `-> m_VirtualView
167mitk::TrackingDeviceSource::Pointer m_Source;
168mitk::NavigationDataObjectVisualizationFilter::Pointer m_PermanentRegistrationFilter;
169mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer;
170mitk::CameraVisualization::Pointer m_VirtualView;
171//in addition to the pipeline objects, pointers to the navigation data objects are stored for fast access:
172mitk::NavigationData::Pointer m_InstrumentNavigationData;
173mitk::NavigationData::Pointer m_ObjectmarkerNavigationData;
174
175//####################### other members ######################################
176QTimer* m_Timer;
177
178//members for the point set recording
179mitk::NavigationData::Pointer m_PointSetRecordingNavigationData;
180mitk::PointSet::Pointer m_PSRecordingPointSet;
184
185//members for initial registration
186mitk::DataNode::Pointer m_ImageFiducialsDataNode;
187mitk::DataNode::Pointer m_TrackerFiducialsDataNode;
188
189//members for permanent registration
191mitk::NavigationData::Pointer m_T_MarkerRel;
192mitk::NavigationData::Pointer m_T_ObjectReg;
193mitk::AffineTransform3D::Pointer m_T_ImageReg;
194mitk::AffineTransform3D::Pointer m_T_ImageGeo;
195mitk::NavigationData::Pointer m_ObjectmarkerNavigationDataLastUpdate;
196
197//######################## some internal help methods ############################
202bool IsTransformDifferenceHigh(mitk::NavigationData::Pointer transformA, mitk::NavigationData::Pointer transformB, double euclideanDistanceThreshold = .8, double angularDifferenceThreshold = .8);
203
204
205
206};
207
208#endif
QmitkIGTTrackingLabView.
mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer
visualization filter
static const std::string VIEW_ID
mitk::NavigationDataObjectVisualizationFilter::Pointer m_PermanentRegistrationFilter
this filter transforms from tracking coordinates into mitk world coordinates if needed it is intercon...
void CreateQtPartControl(QWidget *parent) override
mitk::PointSet::Pointer m_PSRecordingPointSet
bool IsTransformDifferenceHigh(mitk::NavigationData::Pointer transformA, mitk::NavigationData::Pointer transformB, double euclideanDistanceThreshold=.8, double angularDifferenceThreshold=.8)
mitk::TrackingDeviceSource::Pointer m_Source
source that connects to the tracking device
mitk::NavigationData::Pointer m_T_MarkerRel
void OnVirtualCamera(bool on)
This method activates the virtual camera.
mitk::NavigationData::Pointer m_ObjectmarkerNavigationDataLastUpdate
this is the position of the object marker from the last call of update(); it is used to check the dif...
void OnAddRegistrationTrackingFiducial()
This method adds a new fiducial to the tracker fiducials PointSet.
QmitkIGTTrackingLabView()
default constructor
mitk::NavigationData::Pointer m_InstrumentNavigationData
navigation data of instrument
mitk::AffineTransform3D::Pointer m_T_ImageGeo
QTimer * m_Timer
central timer which updates the IGT pipeline
void OnInitialRegistration()
This method calls the initial fiducial registration.
void DestroyIGTPipeline()
This method destroys the filter pipeline.
mitk::NavigationData::Pointer m_T_ObjectReg
void CreateConnections()
This method creates the SIGNAL SLOT connections.
mitk::NavigationData::Pointer m_ObjectmarkerNavigationData
navigation data of object marker
mitk::NavigationData::Pointer m_PointSetRecordingNavigationData
mitk::PointSet::Pointer m_PermanentRegistrationSourcePoints
void OnPermanentRegistration(bool on)
This method activates the permanent registration based on one tool's position.
void OnPointSetRecording(bool record)
This method starts the PointSet recording.
Ui::QmitkIGTTrackingLabViewControls m_Controls
mitk::DataNode::Pointer m_TrackerFiducialsDataNode
~QmitkIGTTrackingLabView() override
default destructor
void InitializeRegistration()
This method initializes the registration for the FiducialRegistrationWidget.
mitk::AffineTransform3D::Pointer m_T_ImageReg
mitk::CameraVisualization::Pointer m_VirtualView
filter to update the vtk camera according to the reference navigation data
mitk::DataNode::Pointer m_ImageFiducialsDataNode
void CreateBundleWidgets()
This method creates all widgets this bundle needs.
void OnSetupNavigation()
This method sets up the navigation pipeline during initialization.