Medical Imaging Interaction Toolkit  2018.4.99-e1268d66
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 (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 MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_
14 #define MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_
15 
17 #include <mitkPointSet.h>
18 #include <itkLandmarkBasedTransformInitializer.h>
19 #include <itkQuaternionRigidTransform.h>
20 #include <itkImage.h>
21 
22 
23 namespace mitk {
24 
43  {
44  public:
46  itkFactorylessNewMacro(Self)
47  itkCloneMacro(Self)
48 
49  typedef std::vector<mitk::ScalarType> ErrorVector;
50  typedef itk::VersorRigid3DTransform< double > LandmarkTransformType;
51 
56  virtual void SetSourceLandmarks(mitk::PointSet::Pointer sourcePointSet);
57 
62  virtual void SetTargetLandmarks(mitk::PointSet::Pointer targetPointSet);
63 
64  virtual bool IsInitialized() const;
65 
70  mitk::ScalarType GetFRE() const;
71 
76  mitk::ScalarType GetFREStdDev() const;
77 
82  mitk::ScalarType GetRMSError() const;
83 
88  mitk::ScalarType GetMinError() const;
89 
94  mitk::ScalarType GetMaxError() const;
95 
100  mitk::ScalarType GetAbsMaxError() const;
101 
106  const ErrorVector& GetErrorVector() const;
107 
108  itkSetMacro(UseICPInitialization, bool);
109  itkGetMacro(UseICPInitialization, bool);
110  itkBooleanMacro(UseICPInitialization);
111 
112  itkGetConstObjectMacro(LandmarkTransform, LandmarkTransformType);
113 
114  protected:
115  typedef itk::Image< signed short, 3> ImageType; // only because itk::LandmarkBasedTransformInitializer must be templated over two imagetypes
116 
117  typedef itk::LandmarkBasedTransformInitializer< LandmarkTransformType, ImageType, ImageType > TransformInitializerType;
118  typedef TransformInitializerType::LandmarkPointContainer LandmarkPointContainer;
119  typedef itk::QuaternionRigidTransform<double> QuaternionTransformType;
120 
126 
131  void GenerateData() override;
132 
147  bool FindCorrespondentLandmarks(LandmarkPointContainer& sources, const LandmarkPointContainer& targets) const;
148 
155  void InitializeLandmarkTransform(LandmarkPointContainer& sources, const LandmarkPointContainer& targets);
156 
160  void UpdateLandmarkTransform(const LandmarkPointContainer &sources, const LandmarkPointContainer &targets);
161  void AccumulateStatistics(ErrorVector& vector);
162 
163  void PrintSelf( std::ostream& os, itk::Indent indent ) const override;
164 
165  mitk::ScalarType m_ErrorMean;
166  mitk::ScalarType m_ErrorStdDev;
167  mitk::ScalarType m_ErrorRMS;
168  mitk::ScalarType m_ErrorMin;
169  mitk::ScalarType m_ErrorMax;
170  mitk::ScalarType m_ErrorAbsMax;
171 
172  LandmarkPointContainer m_SourcePoints;
173  LandmarkPointContainer m_TargetPoints;
174  TransformInitializerType::Pointer m_LandmarkTransformInitializer;
175  LandmarkTransformType::Pointer m_LandmarkTransform;
176 
177  QuaternionTransformType::Pointer m_QuatLandmarkTransform;
178  QuaternionTransformType::Pointer m_QuatTransform;
179 
180  ErrorVector m_Errors;
181  bool m_UseICPInitialization;
182  };
183 } // namespace mitk
184 #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...
#define MITKIGT_EXPORT
Data structure which stores a set of points. Superclass of mitk::Mesh.
Definition: mitkPointSet.h:75
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:72
itk::LandmarkBasedTransformInitializer< LandmarkTransformType, ImageType, ImageType > TransformInitializerType
itk::Image< signed short, 3 > ImageType
returns the current landmark transform
TransformInitializerType::LandmarkPointContainer LandmarkPointContainer