Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkNavigationDataLandmarkTransformFilter.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 MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_
18 #define MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_
19 
21 #include <mitkPointSet.h>
22 #include <itkLandmarkBasedTransformInitializer.h>
23 #include <itkQuaternionRigidTransform.h>
24 #include <itkImage.h>
25 
26 
27 namespace mitk {
28 
47  {
48  public:
50  itkFactorylessNewMacro(Self)
51  itkCloneMacro(Self)
52 
53  typedef std::vector<mitk::ScalarType> ErrorVector;
54  typedef itk::VersorRigid3DTransform< double > LandmarkTransformType;
55 
60  virtual void SetSourceLandmarks(mitk::PointSet::Pointer sourcePointSet);
61 
66  virtual void SetTargetLandmarks(mitk::PointSet::Pointer targetPointSet);
67 
68  virtual bool IsInitialized() const;
69 
74  mitk::ScalarType GetFRE() const;
75 
80  mitk::ScalarType GetFREStdDev() const;
81 
86  mitk::ScalarType GetRMSError() const;
87 
92  mitk::ScalarType GetMinError() const;
93 
98  mitk::ScalarType GetMaxError() const;
99 
104  mitk::ScalarType GetAbsMaxError() const;
105 
110  const ErrorVector& GetErrorVector() const;
111 
112  itkSetMacro(UseICPInitialization, bool);
113  itkGetMacro(UseICPInitialization, bool);
114  itkBooleanMacro(UseICPInitialization);
115 
116  itkGetConstObjectMacro(LandmarkTransform, LandmarkTransformType);
117 
118  protected:
119  typedef itk::Image< signed short, 3> ImageType; // only because itk::LandmarkBasedTransformInitializer must be templated over two imagetypes
120 
121  typedef itk::LandmarkBasedTransformInitializer< LandmarkTransformType, ImageType, ImageType > TransformInitializerType;
122  typedef TransformInitializerType::LandmarkPointContainer LandmarkPointContainer;
123  typedef itk::QuaternionRigidTransform<double> QuaternionTransformType;
124 
130 
135  virtual void GenerateData() override;
136 
151  bool FindCorrespondentLandmarks(LandmarkPointContainer& sources, const LandmarkPointContainer& targets) const;
152 
159  void InitializeLandmarkTransform(LandmarkPointContainer& sources, const LandmarkPointContainer& targets);
160 
164  void UpdateLandmarkTransform(const LandmarkPointContainer &sources, const LandmarkPointContainer &targets);
165  void AccumulateStatistics(ErrorVector& vector);
166 
167  void PrintSelf( std::ostream& os, itk::Indent indent ) const override;
168 
169  mitk::ScalarType m_ErrorMean;
170  mitk::ScalarType m_ErrorStdDev;
171  mitk::ScalarType m_ErrorRMS;
172  mitk::ScalarType m_ErrorMin;
173  mitk::ScalarType m_ErrorMax;
174  mitk::ScalarType m_ErrorAbsMax;
175 
176  LandmarkPointContainer m_SourcePoints;
177  LandmarkPointContainer m_TargetPoints;
178  TransformInitializerType::Pointer m_LandmarkTransformInitializer;
179  LandmarkTransformType::Pointer m_LandmarkTransform;
180 
181  QuaternionTransformType::Pointer m_QuatLandmarkTransform;
182  QuaternionTransformType::Pointer m_QuatTransform;
183 
184  ErrorVector m_Errors;
185  bool m_UseICPInitialization;
186  };
187 } // namespace mitk
188 #endif /* MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_ */
NavigationDataToNavigationDataFilter is the base class of all filters that receive NavigationDatas as...
double ScalarType
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
NavigationDataLandmarkTransformFilter applies a itk-landmark-transformation defined by source and tar...
Data structure which stores a set of points. Superclass of mitk::Mesh.
Definition: mitkPointSet.h:79
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Image class for storing images.
Definition: mitkImage.h:76
itk::LandmarkBasedTransformInitializer< LandmarkTransformType, ImageType, ImageType > TransformInitializerType
itk::Image< signed short, 3 > ImageType
returns the current landmark transform
TransformInitializerType::LandmarkPointContainer LandmarkPointContainer