Medical Imaging Interaction Toolkit  2022.04.99-e36380da
Medical Imaging Interaction Toolkit
mitkPolhemusTrackingDevice.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 MITKPolhemusTRACKINGDEVICE_H_HEADER_INCLUDED_
14 #define MITKPolhemusTRACKINGDEVICE_H_HEADER_INCLUDED_
15 
16 
17 #include <vector>
18 #include <mitkIGTConfig.h>
19 #include <mitkTrackingDevice.h>
20 #include <mitkPolhemusTool.h>
21 #include <thread>
22 
23 namespace mitk
24 {
34  {
35  public:
36 
38  itkFactorylessNewMacro(Self);
39  itkCloneMacro(Self);
40 
46  virtual bool StartTracking() override;
47 
52  virtual bool StopTracking() override;
53 
58  virtual bool OpenConnection() override;
59 
63  virtual bool CloseConnection() override;
64 
68  virtual unsigned int GetToolCount() const override;
69 
75  TrackingTool* GetTool(unsigned int toolNumber) const override;
76 
77 
89  mitk::TrackingTool* AddTool(const char* toolName, int toolPort);
90 
91 
92 
93  bool IsDeviceInstalled();
94 
96  virtual bool AutoDetectToolsAvailable();
97 
102  virtual mitk::NavigationToolStorage::Pointer AutoDetectTools();
103 
105  void SetHemisphereTrackingEnabled(bool _HemisphereTrackingEnabled);
106 
108  bool GetHemisphereTrackingEnabled(int _tool);
109 
111  void ToggleHemisphere(int _tool = -1);
112 
114  void SetHemisphere(int _tool, mitk::Vector3D _hemisphere);
115 
117  mitk::Vector3D GetHemisphere(int _tool);
118 
121  void AdjustHemisphere(int _tool);
122 
123  protected:
126 
133  bool InternalAddTool(PolhemusTool::Pointer tool);
134 
140  void TrackTools();
141 
145  std::vector<PolhemusTool::Pointer> GetAllTools();
146 
150  PolhemusInterface* GetDevice();
151 
152  void ThreadStartTracking();
153 
154  std::vector<PolhemusTool::Pointer> m_AllTools;
155  PolhemusInterface::Pointer m_Device;
156  std::thread m_Thread;
158  };
159 }//mitk
160 #endif /* MITKPolhemusTRACKINGDEVICE_H_HEADER_INCLUDED_ */
MITKIGT_EXPORT
#define MITKIGT_EXPORT
Definition: MitkIGTExports.h:15
mitk::PolhemusTrackingDevice::m_Device
PolhemusInterface::Pointer m_Device
represents the interface to the tracking hardware
Definition: mitkPolhemusTrackingDevice.h:155
mitkIGTConfig.h
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::TrackingDevice
Interface for all Tracking Devices.
Definition: mitkTrackingDevice.h:34
mitkPolhemusTool.h
mitk::PolhemusInterface
An object of this class represents the interface to Polhemus trackers. All variables with the name "t...
Definition: mitkPolhemusInterface.h:42
mitk::Vector< ScalarType, 3 >
mitk::PolhemusTrackingDevice::m_HemisphereTrackingEnabled
bool m_HemisphereTrackingEnabled
Definition: mitkPolhemusTrackingDevice.h:157
mitk::TrackingTool
Interface for all Tracking Tools.
Definition: mitkTrackingTool.h:42
mitk::PolhemusTrackingDevice
An object of this class represents Polhemus tracking device. You can add tools to this device,...
Definition: mitkPolhemusTrackingDevice.h:33
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::PolhemusTrackingDevice::m_Thread
std::thread m_Thread
Definition: mitkPolhemusTrackingDevice.h:156
mitkTrackingDevice.h
mitk::PolhemusTrackingDevice::m_AllTools
std::vector< PolhemusTool::Pointer > m_AllTools
vector holding all tools
Definition: mitkPolhemusTrackingDevice.h:154