Medical Imaging Interaction Toolkit  2021.02.99-e55a5d2f
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 
146  bool FindCorrespondentLandmarks(LandmarkPointContainer& sources, const LandmarkPointContainer& targets) const;
147 
154  void InitializeLandmarkTransform(LandmarkPointContainer& sources, const LandmarkPointContainer& targets);
155 
159  void UpdateLandmarkTransform(const LandmarkPointContainer &sources, const LandmarkPointContainer &targets);
160  void AccumulateStatistics(ErrorVector& vector);
161 
162  void PrintSelf( std::ostream& os, itk::Indent indent ) const override;
163 
170 
171  LandmarkPointContainer m_SourcePoints;
172  LandmarkPointContainer m_TargetPoints;
173  TransformInitializerType::Pointer m_LandmarkTransformInitializer;
174  LandmarkTransformType::Pointer m_LandmarkTransform;
175 
176  QuaternionTransformType::Pointer m_QuatLandmarkTransform;
177  QuaternionTransformType::Pointer m_QuatTransform;
178 
179  ErrorVector m_Errors;
181  };
182 } // namespace mitk
183 #endif /* MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_ */
mitk::ScalarType m_ErrorStdDev
standard deviation of the Fiducial Registration Error
TransformInitializerType::Pointer m_LandmarkTransformInitializer
landmark based transform initializer
NavigationDataToNavigationDataFilter is the base class of all filters that receive NavigationDatas as...
mitk::ScalarType m_ErrorMax
maximum registration error / worst fitting landmark distance
double ScalarType
mitk::ScalarType m_ErrorMin
minimum registration error / best fitting landmark distance
DataCollection - Class to facilitate loading/accessing structured data.
NavigationDataLandmarkTransformFilter applies a itk-landmark-transformation defined by source and tar...
bool m_UseICPInitialization
find source <–> target point correspondences with iterative closest point optimization ...
mitk::ScalarType m_ErrorMean
Fiducial Registration Error.
LandmarkPointContainer m_SourcePoints
positions of the source points
#define MITKIGT_EXPORT
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
ErrorVector m_Errors
stores the euclidean distance of each transformed source landmark and its respective target landmark ...
QuaternionTransformType::Pointer m_QuatTransform
further transform needed to rotate orientation
mitk::ScalarType m_ErrorAbsMax
the absolute maximum registration error
itk::LandmarkBasedTransformInitializer< LandmarkTransformType, ImageType, ImageType > TransformInitializerType
LandmarkTransformType::Pointer m_LandmarkTransform
transform calculated from source and target points
itk::Image< signed short, 3 > ImageType
returns the current landmark transform
TransformInitializerType::LandmarkPointContainer LandmarkPointContainer
LandmarkPointContainer m_TargetPoints
positions of the target points
mitk::ScalarType m_ErrorRMS
Root Mean Square of the registration error.
QuaternionTransformType::Pointer m_QuatLandmarkTransform
transform needed to rotate orientation