MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkMITKIGTTrackingToolboxView.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#ifndef QmitkMITKIGTTrackingToolboxView_h
14#define QmitkMITKIGTTrackingToolboxView_h
15
16#include <berryISelectionListener.h>
17#include <ctkServiceReference.h>
18#include <ctkServiceEvent.h>
19
20#include <QmitkAbstractView.h>
21
22#include "ui_QmitkMITKIGTTrackingToolboxViewControls.h"
23
24//mitk headers
29#include <mitkIGTLServer.h>
31
32//QT headers
33#include <QTimer>
34
36
37//Forward declaration of MITK classes
38namespace mitk
39{
40 class NeedleProjectionFilter;
41}
42
48class QmitkMITKIGTTrackingToolboxView : public QmitkAbstractView
49{
50 // this is needed for all Qt objects that should have a Qt meta-object
51 // (everything that derives from QObject and wants to have signal/slots)
52 Q_OBJECT
53
54 public:
55
56 static const std::string VIEW_ID;
57
60
61 void CreateQtPartControl(QWidget *parent) override;
62
66 void SetFocus() override;
67
68 protected slots:
69
74 void OnLoadTools();
75
78
81
84
87
90
92 void OnConnect();
93
95 void OnDisconnect();
96
98 void OnStartTracking();
99
101 void OnStopTracking();
102
105 void OnChooseFileClicked();
106
109 void StartLogging();
110
112 void StopLogging();
113
116
118 void OnTrackingVolumeChanged(QString qstr);
119
122
126 void OnAutoDetectTools();
127
131
134
136 void OnResetTools();
137
139 void OnAddSingleTool();
140
143
146
147 void OnTimeOut();
148
153 void OnToolStorageChanged(const ctkServiceEvent event);
154
155 /* This slot enables selection of tool for projection*/
156 void SelectToolProjection(int idx);
157
158 protected slots:
159
160 //help slots for enable/disable buttons
169 void EnableDisableTimerButtons(int enable);
172
173 //slots for worker thread
174 void OnAutoDetectToolsFinished(bool success, QString errorMessage);
175 void OnConnectFinished(bool success, QString errorMessage);
176 void OnStartTrackingFinished(bool success, QString errorMessage);
177 void OnStopTrackingFinished(bool success, QString errorMessage);
178 void OnDisconnectFinished(bool success, QString errorMessage);
179
180 protected:
181
182 Ui::QmitkMITKIGTTrackingToolboxViewControls* m_Controls;
183
189
190 mitk::NavigationToolStorage::Pointer m_toolStorage;
191 mitk::DataNode::Pointer m_TrackingVolumeNode;
193
196
198 void MessageBox(std::string s);
199
201 void GlobalReinit();
202
203 //members for the filter pipeline
205 mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter;
206 mitk::NavigationDataRecorder::Pointer m_loggingFilter;
208
209 //members for open IGT link server
210 mitk::NavigationDataToIGTLMessageFilter::Pointer m_IGTLConversionFilter;
211 mitk::IGTLServer::Pointer m_IGTLServer;
212 mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider;
213
218
220
225 void ReplaceCurrentToolStorage(mitk::NavigationToolStorage::Pointer newStorage, std::string newStorageName);
226
230 void StoreUISettings();
231
235 void LoadUISettings();
239 void UpdateToolStorageLabel(QString pathOfLoadedStorage);
243 void AutoSaveToolStorage();
244
248 void ShowToolProjection(int index);
253
254
255 //members for worker thread
258
259 private:
260 ctkServiceReference m_DeviceTypeServiceReference;
261 mitk::TrackingDeviceTypeCollection* m_DeviceTypeCollection;
262 mitk::DataNode::Pointer m_ToolProjectionNode;
263};
264
265
266#endif
void OnStartTracking()
This slot tries to start tracking with the current device. If start tracking fails the user gets an e...
void StartLogging()
This slot starts logging. Logging is only possible if a device is tracking. If not the logging mechan...
void UpdateToolStorageLabel(QString pathOfLoadedStorage)
void OnChooseFileClicked()
This slot is called if the user wants to choose a file name for logging. A new windows to navigate th...
void StoreUISettings()
Stores the properties of some QWidgets (and the tool storage file name) to QSettings.
mitk::NavigationDataToIGTLMessageFilter::Pointer m_IGTLConversionFilter
QString m_AutoSaveFilename
>stores the filename of the current tool storage
void OnDisconnect()
This slot disconnects from the device.
bool lastTrackingVolumeState
>holds the data node of the tracking volume if volume is visualized
void OnShowHideToolAxisClicked()
Shows or hides the standard tool axis.
void OnStartTrackingFinished(bool success, QString errorMessage)
void CreateQtPartControl(QWidget *parent) override
mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter
void OnShowHideToolProjectionClicked()
Shows or hides the tool projection of the standard tool axis.
QTimer * m_TrackingRenderTimer
This timer updates the IGT pipline and also the logging filter if logging is activated.
void OnChangeRenderUpdateRate()
Slot for showing the rendering disabled warning label.
void OnToolStorageChanged(const ctkServiceEvent event)
This function is called, when anything in the ToolStorage changed, e.g. AddTool or EditTool....
void LoadUISettings()
Loads the properties of some QWidgets (and the tool storage file name) from QSettings.
void OnShowTrackingVolumeChanged()
Shows or hides the tracking volume according to the checkboxe's state.
void OnAutoDetectToolsFinished(bool success, QString errorMessage)
mitk::NavigationDataRecorder::Pointer m_loggingFilter
void OnAddSingleToolCanceled()
This slot is called if the user cancels the creation of a new tool.
void OnDisconnectFinished(bool success, QString errorMessage)
void UpdateRenderTrackingTimer()
Slot for tracking timer. The timer updates the IGT pipline and also the logging filter if logging is ...
void OnStopTrackingFinished(bool success, QString errorMessage)
void OnConnect()
This slot connects to the device. In status "connected" configuration of the device is disabled.
void OnTrackingDeviceChanged()
This slot enables / disables UI elements depending on the tracking device after a device is changed.
Ui::QmitkMITKIGTTrackingToolboxViewControls * m_Controls
void OnAddSingleToolFinished()
This slot is called if the user finishes the creation of a new tool.
void OnToggleFileExtension()
changes name of the filename when switching fileextension by radio button
void OnConnectFinished(bool success, QString errorMessage)
QmitkMITKIGTTrackingToolboxViewWorker * m_Worker
mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider
void OnTrackingVolumeChanged(QString qstr)
This slot selects the Tracking Volume appropriate for a given model.
void StopLogging()
This slot stops logging. If logging is not running it does nothing.
void OnAutoDetectTools()
This slot auto detects tools of a NDI Aurora tracking device. If tools where found they will be store...
mitk::NavigationToolStorage::Pointer m_toolStorage
void OnLoadTools()
This slot is called if the user wants to load a new tool file. A new window opens where the user can ...
void OnResetTools()
Resets the Tracking Tools: this means all tools are removed.
void MessageBox(std::string s)
>a filename for auto saving tools if no m_ToolStorageFilename was given by the user
void OnStopTracking()
This slot stops tracking. If tracking is not strated it does nothing.
void OnAddSingleTool()
Opens a dialog where a new navigation tool can be created.
mitk::DataNode::Pointer m_TrackingVolumeNode
>stores the loaded tools
itk::SmartPointer< mitk::NeedleProjectionFilter > m_NeedleProjectionFilter
void ReplaceCurrentToolStorage(mitk::NavigationToolStorage::Pointer newStorage, std::string newStorageName)
>Stores if simple UI mode is enabled
QString m_ToolStorageFilename
>temporary holds the state of the tracking volume (activated/not activated) during some methods
This class is a collection for information of all Tracking Device Types (derived from abstract Tracki...
IGT Exceptions.