Medical Imaging Interaction Toolkit  2018.4.99-7e02155b
Medical Imaging Interaction Toolkit
mitkTrackingTool.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 MITKTRACKINGTOOL_H_HEADER_INCLUDED_
15 #define MITKTRACKINGTOOL_H_HEADER_INCLUDED_
16 
17 #include <itkObject.h>
18 #include <MitkIGTExports.h>
19 #include <mitkCommon.h>
20 #include <mitkNumericTypes.h>
21 #include <itkFastMutexLock.h>
22 
23 namespace mitk
24 {
42  class MITKIGT_EXPORT TrackingTool : public itk::Object
43  {
44  public:
46  itkFactorylessNewMacro(Self);
47  itkCloneMacro(Self);
48 
49  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
50 
51  virtual const char* GetToolName() const;
52  virtual void SetToolName(const std::string _arg);
53  virtual void SetToolName(const char* _arg);
54 
55  Point3D GetToolTipPosition() const;
56  Quaternion GetToolAxisOrientation() const;
57  virtual void SetToolTipPosition(Point3D toolTipPosition, Quaternion orientation, ScalarType eps=0.0);
58  virtual bool IsToolTipSet() const;
59 
60  virtual void GetPosition(Point3D& position) const;
61  virtual void SetPosition(Point3D position);
62 
63  virtual void GetOrientation(Quaternion& orientation) const;
64  virtual void SetOrientation(Quaternion orientation);
65 
66  virtual bool Enable();
67  virtual bool Disable();
68  virtual bool IsEnabled() const;
69 
70  virtual void SetDataValid(bool isDataValid);
71  virtual bool IsDataValid() const;
72 
73  virtual float GetTrackingError() const;
74  virtual void SetTrackingError(float error);
75 
76  virtual const char* GetErrorMessage() const;
77  virtual void SetErrorMessage(const char* _arg);
78 
79  itkSetMacro(IGTTimeStamp, double)
80  itkGetConstMacro(IGTTimeStamp, double)
81 
82  protected:
83  TrackingTool();
84  ~TrackingTool() override;
85 
86  std::string m_ToolName;
87  std::string m_ErrorMessage;
88  double m_IGTTimeStamp;
89  itk::FastMutexLock::Pointer m_MyMutex;
90 
94  bool m_Enabled;
95  bool m_DataValid;
99  };
100 } // namespace mitk
101 #endif /* MITKTRACKINGTOOL_H_HEADER_INCLUDED_ */
bool m_DataValid
if true, data in m_Position and m_Orientation is valid, e.g. true tracking data
MITKCORE_EXPORT const ScalarType eps
Interface for all Tracking Tools.
double m_IGTTimeStamp
contains the time at which the tracking data was recorded
Quaternion m_Orientation
holds the orientation of the tool´in global tracking coordinates
double ScalarType
std::string m_ErrorMessage
if a tool is invalid, this member should contain a human readable explanation of why it is invalid ...
itk::FastMutexLock::Pointer m_MyMutex
mutex to control concurrent access to the tool
DataCollection - Class to facilitate loading/accessing structured data.
Time stamp in milliseconds.
Quaternion m_ToolAxisOrientation
holds the rotation of the sensor coordinate system such that the z-axis coincides with the main tool ...
Point3D m_Position
holds the position of the tool in global tracking coordinates
#define MITKIGT_EXPORT
bool m_Enabled
if true, tool is enabled and should receive tracking updates from the tracking device ...
Point3D m_ToolTipPosition
holds the position of the tool tip in the coordinate system of the tracking sensor ...
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
float m_TrackingError
holds the tracking error of the tool
vnl_quaternion< ScalarType > Quaternion
std::string m_ToolName
every tool has a name that can be used to identify it.