Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
QmitkNDIConfigurationWidget.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkNDIConfigurationWidget_h
14 #define QmitkNDIConfigurationWidget_h
15 
16 #include "ui_QmitkNDIConfigurationWidget.h"
17 #include "mitkNDITrackingDevice.h"
19 #include "QStringList"
20 #include "MitkIGTUIExports.h"
21 #include "mitkNodePredicateBase.h"
22 
23 #include "mitkNavigationTool.h"
24 
26 namespace mitk
27 {
28  class DataStorage;
29 };
30 
39 class MITKIGTUI_EXPORT QmitkNDIConfigurationWidget : public QWidget
40 {
41  Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
42 public:
43  QmitkNDIConfigurationWidget(QWidget* parent);
44  ~QmitkNDIConfigurationWidget() override;
45 
46  DEPRECATED(std::string GetDeviceName() const);
47  DEPRECATED(mitk::NDITrackingDevice* GetTracker() const);
48  DEPRECATED(mitk::DataStorage* GetDataStorage() const);
49  DEPRECATED(mitk::NodePredicateBase* GetPredicate() const);
50  DEPRECATED(const QStringList& GetToolTypes() const);
51  DEPRECATED(void SetToolTypes(const QStringList& types));
52  DEPRECATED(void SetDataStorage(mitk::DataStorage* ds));
53  DEPRECATED(void SetPredicate(mitk::NodePredicateBase::Pointer p));
54  DEPRECATED(void SetTagPropertyName(const std::string& name));
55  DEPRECATED(void SetTagProperty(mitk::BaseProperty::Pointer prop));
56 
57  DEPRECATED(const QString GetToolType(unsigned int index) const);
58  DEPRECATED(const QString GetToolName(unsigned int index) const);
59  QMap<QString, unsigned int> GetToolAndTypes() const;
60  DEPRECATED(QList<unsigned int> GetToolsByToolType(QString toolType) const);
61  DEPRECATED(mitk::DataNode* GetNode(unsigned int index) const);
62 
63 
64  signals:
65  void ToolsAdded(QStringList tools);
66  void ToolsChanged();
67  void Connected();
68  void Disconnected();
69  void RepresentationChanged( int row , mitk::Surface::Pointer surface ); // returns the row number of the clicked tableitem for changing tool representation
70  void SignalToolNameChanged(int id, QString name);
71  void SignalSavedTool(int id, QString surfaceFilename);
72  void SignalLoadTool(int id, mitk::DataNode::Pointer dn);
73 
74  public slots:
75  void SetDeviceName(const char* dev);
76  void ShowToolRepresentationColumn();
77  void EnableAddToolsButton(bool enable);
78  void EnableDiscoverNewToolsButton(bool enable); ;
79 
80  protected slots:
81  void OnConnect();
82  void OnDisconnect();
83  void OnDiscoverTools();
84  void OnDiscoverDevices();
85  void OnAddPassiveTool();
86  void UpdateTrackerFromToolTable(const QModelIndex & topLeft, const QModelIndex & /*bottomRight*/);
87  void OnTableItemClicked(const QModelIndex & topLeft);
88  void OnDisoverDevicesBtnInfo();
89  void OnTableCellChanged(int row, int column);
90  void OnSaveTool();
91  void OnLoadTool();
92 
93 
94 protected:
95  typedef QMap<QString, mitk::TrackingDeviceType> PortDeviceMap; // key is port name (e.g. "COM1", "/dev/ttyS0"), value will be filled with the type of tracking device at this port
102  void ScanPortsForNDITrackingDevices(PortDeviceMap& portsAndDevices);
103  mitk::TrackingDeviceType ScanPort(QString port);
104  mitk::NavigationTool::Pointer GenerateNavigationTool(mitk::TrackingTool* tool);
105 
106  QStringList GetToolNamesList();
107 
108  void CreateTracker();
109  void SetupTracker();
110  QString GetStatusText();
111 
112  void UpdateWidgets();
113  void UpdateToolTable();
114  virtual void CreateQtPartControl(QWidget *parent);
115  virtual void CreateConnections();
116  void HidePolarisOptionsGroupbox( bool on );
117  void HideAuroraOptionsGroupbox( bool on );
118 
119  Ui::QmitkNDIConfigurationWidget* m_Controls;
120  mitk::NDITrackingDevice::Pointer m_Tracker;
121  mitk::TrackingDeviceSource::Pointer m_Source;
123 
126 
127  mitk::Surface::Pointer LoadSurfaceFromSTLFile(QString surfaceFilename);
128 
129 };
130 #endif
QmitkNDIConfigurationWidget::m_Delegate
QmitkNDIToolDelegate * m_Delegate
Definition: QmitkNDIConfigurationWidget.h:122
QmitkNDIToolDelegate
An item delegate for rendering and editing mitk::Properties in a QTableView.
Definition: QmitkNDIToolDelegate.h:35
QmitkNDIConfigurationWidget::m_RepresentatonCellDefaultText
QString m_RepresentatonCellDefaultText
Definition: QmitkNDIConfigurationWidget.h:125
QmitkNDIConfigurationWidget::m_SROMCellDefaultText
QString m_SROMCellDefaultText
Definition: QmitkNDIConfigurationWidget.h:124
DEPRECATED
#define DEPRECATED(func)
Definition: mitkCommon.h:175
itk::SmartPointer< Self >
mitk::NodePredicateBase
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
Definition: mitkNodePredicateBase.h:35
mitkNodePredicateBase.h
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
QmitkNDIConfigurationWidget::PortDeviceMap
QMap< QString, mitk::TrackingDeviceType > PortDeviceMap
Definition: QmitkNDIConfigurationWidget.h:95
mitk::NDITrackingDevice
superclass for specific NDI tracking Devices that use serial communication.
Definition: mitkNDITrackingDevice.h:40
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
mitk::TrackingTool
Interface for all Tracking Tools.
Definition: mitkTrackingTool.h:42
QmitkNDIConfigurationWidget::m_Source
mitk::TrackingDeviceSource::Pointer m_Source
Definition: QmitkNDIConfigurationWidget.h:121
mitkTrackingDeviceSource.h
mitkNDITrackingDevice.h
QmitkNDIConfigurationWidget::m_Controls
Ui::QmitkNDIConfigurationWidget * m_Controls
gui widgets
Definition: QmitkNDIConfigurationWidget.h:119
mitk::TrackingDeviceType
std::string TrackingDeviceType
Definition: mitkTrackingTypes.h:22
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
QmitkNDIConfigurationWidget
Definition: QmitkNDIConfigurationWidget.h:39
QmitkNDIConfigurationWidget::m_Tracker
mitk::NDITrackingDevice::Pointer m_Tracker
tracking device object
Definition: QmitkNDIConfigurationWidget.h:120
mitkNavigationTool.h