Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkTrackingDevice.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 
14 #ifndef mitkTrackingDevice_h
15 #define mitkTrackingDevice_h
16 
17 #include <MitkIGTExports.h>
18 #include "itkObject.h"
19 #include "mitkCommon.h"
20 #include "mitkTrackingTypes.h"
22 #include <mutex>
23 
24 namespace mitk {
25  class TrackingTool; // interface for a tool that can be tracked by the TrackingDevice
26 
34  class MITKIGT_EXPORT TrackingDevice : public itk::Object
35  {
36  public:
38 
52  enum RotationMode {RotationStandard, RotationTransposed};
53 
54  enum TrackingDeviceState {Setup, Ready, Tracking};
55 
61  virtual bool OpenConnection() = 0;
62 
69  virtual bool CloseConnection() = 0;
70 
78  virtual bool StartTracking() = 0;
79 
87  virtual bool StopTracking();
88 
94  virtual TrackingTool* GetTool(unsigned int toolNumber) const = 0;
95 
102  virtual mitk::TrackingTool* GetToolByName(std::string name) const;
103 
107  virtual unsigned int GetToolCount() const = 0;
108 
115  virtual void SetRotationMode(RotationMode r);
116 
120  itkGetConstMacro(RotationMode,RotationMode);
121 
125  TrackingDeviceState GetState() const;
126 
130  TrackingDeviceType GetType() const;
134  void SetType(TrackingDeviceType type);
135 
141  std::string GetTrackingDeviceName();
142 
146  TrackingDeviceData GetData() const;
150  void SetData(TrackingDeviceData data);
151 
167  virtual bool IsDeviceInstalled();
168 
170  virtual bool AutoDetectToolsAvailable();
171 
173  virtual bool AddSingleToolIsAvailable();
174 
179  virtual mitk::NavigationToolStorage::Pointer AutoDetectTools();
180 
181  private:
182  TrackingDeviceState m_State;
183  protected:
184 
188  void SetState(TrackingDeviceState state);
189 
190 
191  TrackingDevice();
192  ~TrackingDevice() override;
193 
195 
197  std::mutex m_StopTrackingMutex;
199  mutable std::mutex m_StateMutex;
201  };
202 } // namespace mitk
203 
204 #endif
mitk::TrackingDevice::m_TrackingFinishedMutex
std::mutex m_TrackingFinishedMutex
mutex to manage control flow of StopTracking()
Definition: mitkTrackingDevice.h:198
mitk::TrackingDevice::RotationMode
RotationMode
Definition: mitkTrackingDevice.h:52
mitk::TrackingDevice::m_StopTracking
bool m_StopTracking
signal stop to tracking thread
Definition: mitkTrackingDevice.h:196
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::TrackingDeviceData
Definition: mitkTrackingTypes.h:34
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::TrackingDevice::m_StopTrackingMutex
std::mutex m_StopTrackingMutex
mutex to control access to m_StopTracking
Definition: mitkTrackingDevice.h:197
mitk::TrackingDevice::m_Data
TrackingDeviceData m_Data
current device Data
Definition: mitkTrackingDevice.h:194
mitk::TrackingDevice
Interface for all Tracking Devices.
Definition: mitkTrackingDevice.h:34
mitk::TrackingDevice::m_StateMutex
std::mutex m_StateMutex
mutex to control access to m_State
Definition: mitkTrackingDevice.h:199
mitkCommon.h
mitk::TrackingDevice::m_RotationMode
RotationMode m_RotationMode
defines the rotation mode Standard or Transposed, Standard is default
Definition: mitkTrackingDevice.h:200
mitk::TrackingDevice::TrackingDeviceState
TrackingDeviceState
Definition: mitkTrackingDevice.h:54
mitkNavigationToolStorage.h
mitk::TrackingTool
Interface for all Tracking Tools.
Definition: mitkTrackingTool.h:42
mitk::TrackingDeviceType
std::string TrackingDeviceType
Definition: mitkTrackingTypes.h:22
mitkTrackingTypes.h