Medical Imaging Interaction Toolkit  2018.4.99-7e02155b
Medical Imaging Interaction Toolkit
mitkNavigationData.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 MITKNAVIGATIONDATA_H_HEADER_INCLUDED_
15 #define MITKNAVIGATIONDATA_H_HEADER_INCLUDED_
16 #include <itkDataObject.h>
17 #include <MitkIGTBaseExports.h>
18 #include <mitkCommon.h>
19 #include <mitkNumericTypes.h>
20 
21 namespace mitk {
22 
36  class MITKIGTBASE_EXPORT NavigationData : public itk::DataObject
37  {
38  public:
39  mitkClassMacroItkParent(NavigationData, itk::DataObject);
40  itkFactorylessNewMacro(Self);
41  itkCloneMacro(Self);
42  mitkNewMacro2Param(Self, mitk::AffineTransform3D::Pointer, const bool);
43  mitkNewMacro1Param(Self, mitk::AffineTransform3D::Pointer);
44 
56  typedef itk::Matrix<mitk::ScalarType,6,6> CovarianceMatrixType;
60  typedef double TimeStampType;
61 
65  itkSetMacro(Position, PositionType);
69  itkGetConstMacro(Position, PositionType);
73  itkSetMacro(Orientation, OrientationType);
77  itkGetConstMacro(Orientation, OrientationType);
81  virtual bool IsDataValid() const;
85  itkSetMacro(DataValid, bool);
89  itkSetMacro(IGTTimeStamp, TimeStampType);
94  itkGetConstMacro(IGTTimeStamp, TimeStampType);
98  itkSetMacro(HasPosition, bool);
102  itkGetConstMacro(HasPosition, bool);
106  itkSetMacro(HasOrientation, bool);
110  itkGetConstMacro(HasOrientation, bool);
114  itkSetMacro(CovErrorMatrix, CovarianceMatrixType);
118  itkGetConstMacro(CovErrorMatrix, CovarianceMatrixType);
122  itkSetStringMacro(Name);
126  itkGetStringMacro(Name);
127 
138  void Graft(const DataObject *data) override;
139 
145  void CopyInformation(const DataObject* data) override;
146 
152  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
153 
158  void SetPositionAccuracy(mitk::ScalarType error);
159 
164  void SetOrientationAccuracy(mitk::ScalarType error);
165 
170  mitk::AffineTransform3D::Pointer GetAffineTransform3D() const;
171 
175  mitk::Matrix3D GetRotationMatrix() const;
176 
183  mitk::Point3D TransformPoint(const mitk::Point3D point) const;
184 
189  mitk::NavigationData::Pointer GetInverse() const;
190 
201  void Compose(const mitk::NavigationData::Pointer n, const bool pre = false);
202 
203  protected:
204  mitkCloneMacro(Self);
205 
206  NavigationData();
207 
208  /*
209  * Copy constructor internally used.
210  */
211  NavigationData(const mitk::NavigationData& toCopy);
212 
224  NavigationData(mitk::AffineTransform3D::Pointer affineTransform3D, const bool checkForRotationMatrix = true);
225 
226  ~NavigationData() override;
227 
231  PositionType m_Position;
235  OrientationType m_Orientation;
236 
244  CovarianceMatrixType m_CovErrorMatrix;
245 
260  TimeStampType m_IGTTimeStamp;
264  std::string m_Name;
265 
266  private:
267 
268  void ResetCovarianceValidity();
269 
270  // pre = false
271  static mitk::NavigationData::Pointer getComposition(const mitk::NavigationData::Pointer nd1, const mitk::NavigationData::Pointer nd2);
272 
273  };
274 
291  MITKIGTBASE_EXPORT bool Equal( const mitk::NavigationData& leftHandSide, const mitk::NavigationData& rightHandSide, ScalarType eps = mitk::eps, bool verbose = false );
292 
293 } // namespace mitk
294 #endif /* MITKNAVIGATIONDATA_H_HEADER_INCLUDED_ */
MITKCORE_EXPORT const ScalarType eps
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:72
itk::Matrix< mitk::ScalarType, 6, 6 > CovarianceMatrixType
type that holds the error characterization of the position and orientation measurements ...
bool m_HasPosition
defines if position part of m_CovErrorMatrix is valid
bool m_HasOrientation
defines if orientation part of m_CovErrorMatrix is valid
double ScalarType
Navigation Data.
OrientationType m_Orientation
holds the orientation part of the tracking data
DataCollection - Class to facilitate loading/accessing structured data.
CovarianceMatrixType m_CovErrorMatrix
A 6x6 covariance matrix parameterizing the Gaussian error distribution of the measured position and o...
mitk::Quaternion OrientationType
Type that holds the orientation part of the tracking data.
Time stamp in milliseconds.
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:85
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
double TimeStampType
type that holds the time at which the data was recorded in milliseconds
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
std::string m_Name
name of the navigation data
vnl_quaternion< ScalarType > Quaternion
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:158
TimeStampType m_IGTTimeStamp
contains the time at which the tracking data was recorded
#define MITKIGTBASE_EXPORT
PositionType m_Position
holds the position part of the tracking data
bool m_DataValid
defines if the object contains valid values
mitk::Point3D PositionType
Type that holds the position part of the tracking data.