Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _QmitkNDIConfigurationWidget_H_INCLUDED
18 #define _QmitkNDIConfigurationWidget_H_INCLUDED
19 
20 #include "ui_QmitkNDIConfigurationWidget.h"
21 #include "mitkNDITrackingDevice.h"
23 #include "QStringList"
24 #include "MitkIGTUIExports.h"
25 #include "mitkNodePredicateBase.h"
26 
27 #include "mitkNavigationTool.h"
28 
30 namespace mitk
31 {
32  class DataStorage;
33 };
34 
43 class MITKIGTUI_EXPORT QmitkNDIConfigurationWidget : public QWidget
44 {
45  Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
46 public:
47  QmitkNDIConfigurationWidget(QWidget* parent);
48  virtual ~QmitkNDIConfigurationWidget();
49 
50  DEPRECATED(std::string GetDeviceName() const);
51  DEPRECATED(mitk::NDITrackingDevice* GetTracker() const);
53  DEPRECATED(mitk::NodePredicateBase* GetPredicate() const);
54  DEPRECATED(const QStringList& GetToolTypes() const);
55  DEPRECATED(void SetToolTypes(const QStringList& types));
56  DEPRECATED(void SetDataStorage(mitk::DataStorage* ds));
57  DEPRECATED(void SetPredicate(mitk::NodePredicateBase::Pointer p));
58  DEPRECATED(void SetTagPropertyName(const std::string& name));
59  DEPRECATED(void SetTagProperty(mitk::BaseProperty::Pointer prop));
60 
61  DEPRECATED(const QString GetToolType(unsigned int index) const);
62  DEPRECATED(const QString GetToolName(unsigned int index) const);
63  DEPRECATED(QMap<QString, unsigned int> GetToolAndTypes() const);
64  DEPRECATED(QList<unsigned int> GetToolsByToolType(QString toolType) const);
65  DEPRECATED(mitk::DataNode* GetNode(unsigned int index) const);
66 
67 
68  signals:
69  void ToolsAdded(QStringList tools);
70  void ToolsChanged();
71  void Connected();
72  void Disconnected();
73  void RepresentationChanged( int row , mitk::Surface::Pointer surface ); // returns the row number of the clicked tableitem for changing tool representation
74  void SignalToolNameChanged(int id, QString name);
75  void SignalSavedTool(int id, QString surfaceFilename);
76  void SignalLoadTool(int id, mitk::DataNode::Pointer dn);
77 
78  public slots:
79  void SetDeviceName(const char* dev);
80  void ShowToolRepresentationColumn();
81  void EnableAddToolsButton(bool enable);
82  void EnableDiscoverNewToolsButton(bool enable); ;
83 
84  protected slots:
85  void OnConnect();
86  void OnDisconnect();
87  void OnDiscoverTools();
88  void OnDiscoverDevices();
89  void OnAddPassiveTool();
90  void UpdateTrackerFromToolTable(const QModelIndex & topLeft, const QModelIndex & /*bottomRight*/);
91  void OnTableItemClicked(const QModelIndex & topLeft);
92  void OnDisoverDevicesBtnInfo();
93  void OnTableCellChanged(int row, int column);
94  void OnSaveTool();
95  void OnLoadTool();
96 
97 
98 protected:
99  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
107  void ScanPortsForNDITrackingDevices(PortDeviceMap& portsAndDevices);
108  mitk::TrackingDeviceType ScanPort(QString port);
109  mitk::NavigationTool::Pointer GenerateNavigationTool(mitk::TrackingTool* tool);
110 
111  QStringList GetToolNamesList();
112 
113  void CreateTracker();
114  void SetupTracker();
115  QString GetStatusText();
116 
117  void UpdateWidgets();
118  void UpdateToolTable();
119  virtual void CreateQtPartControl(QWidget *parent);
120  virtual void CreateConnections();
121  void HidePolarisOptionsGroupbox( bool on );
122  void HideAuroraOptionsGroupbox( bool on );
123 
124  Ui::QmitkNDIConfigurationWidget* m_Controls;
128 
131 
132  mitk::Surface::Pointer LoadSurfaceFromSTLFile(QString surfaceFilename);
133 
134 };
135 #endif // _QmitkNDIConfigurationWidget_H_INCLUDED
136 
Interface for all Tracking Tools.
Data management class that handles 'was created by' relations.
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
static mitk::DataStorage::Pointer GetDataStorage()
QMap< QString, mitk::TrackingDeviceType > PortDeviceMap
An item delegate for rendering and editing mitk::Properties in a QTableView.
Ui::QmitkNDIConfigurationWidget * m_Controls
gui widgets
#define DEPRECATED(func)
Definition: mitkCommon.h:183
std::string GetDeviceName()
mitk::NDITrackingDevice::Pointer m_Tracker
tracking device object
std::string TrackingDeviceType
superclass for specific NDI tracking Devices that use serial communication.
mitk::TrackingDeviceSource::Pointer m_Source
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66