IGSTK
igstkLandmark3DRegistrationErrorEstimator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkLandmark3DRegistrationErrorEstimator.h,v $
5  Language: C++
6  Date: $Date: 2008-06-05 14:54:59 $
7  Version: $Revision: 1.12 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __igstkLandmark3DRegistrationErrorEstimator_h
19 #define __igstkLandmark3DRegistrationErrorEstimator_h
20 
21 #include "igstkStateMachine.h"
22 #include "igstkMacros.h"
23 #include "igstkObject.h"
24 #include "igstkEvents.h"
25 #include "itkPoint.h"
26 #include "itkVersor.h"
27 #include <vector>
28 
29 namespace igstk
30 {
50 {
51 
52 public:
53 
56 
57 public:
58 
60  typedef itk::Point<double, 3> TargetPointType;
61  typedef itk::Point<double, 3> LandmarkPointType;
62  typedef std::vector< LandmarkPointType > LandmarkContainerType;
63 
65  typedef double ErrorType;
66 
68  void RequestSetLandmarkContainer( const LandmarkContainerType & );
69 
71  void RequestSetTargetPoint ( const TargetPointType & );
72 
74  void RequestSetLandmarkRegistrationError ( const ErrorType & );
75 
78 
81 
82 protected:
83 
86 
88  void PrintSelf( std::ostream& os, itk::Indent indent ) const;
89 
90 private:
91 
92  typedef itk::Vector<double, 3> VectorType;
93  typedef LandmarkContainerType::const_iterator PointsContainerConstIterator;
94  typedef double DistanceType;
95  typedef itk::Versor<double> VersorType;
96 
97 
99  void ComputeLandmarksCentroid();
100 
102  void ComputeLandmarkPrincipalAxes();
103 
105  void ComputeRMSDistanceLandmarksFromPrincipalAxes();
106 
108  void SetLandmarkContainerProcessing();
109 
111  void SetTargetPointProcessing();
112 
114  void SetLandmarkRegistrationErrorProcessing( );
115 
116  void ComputeErrorParameters( );
117 
119  void EstimateTargetPointRegistrationErrorProcessing( );
120 
122  void ReportInvalidRequestProcessing();
123 
125  void ReportSuccessInTargetPointRegistrationErrorEstimationProcessing();
126 
128  void ReportFailureInTargePointRegistrationErrorEstimationProcessing();
129 
132  void GetTargetPointRegistrationErrorEstimateProcessing();
133 
135  igstkDeclareStateMacro( Idle );
136  igstkDeclareStateMacro( LandmarkContainerSet );
137  igstkDeclareStateMacro( LandmarkRegistrationErrorSet );
138  igstkDeclareStateMacro( TargetPointSet );
139  igstkDeclareStateMacro( AttemptingToEstimateTargetRegstirationError );
140  igstkDeclareStateMacro( TargetRegistrationErrorEstimated );
141 
142 
144  igstkDeclareInputMacro( LandmarkContainer );
145  igstkDeclareInputMacro( LandmarkRegistrationError );
146  igstkDeclareInputMacro( TargetPoint );
147  igstkDeclareInputMacro( EstimateTargetPointRegistrationError );
148  igstkDeclareInputMacro( TargetPointRegistrationErrorEstimationSuccess );
149  igstkDeclareInputMacro( TargetPointRegistrationErrorEstimationFailure );
150  igstkDeclareInputMacro( GetTargetPointRegistrationErrorEstimate );
151 
152 
155  Landmark3DRegistrationErrorEstimator(const Self&); //purposely not implemented
156  void operator=(const Self&); //purposely not implemented
157 
158  LandmarkContainerType m_LandmarkContainer;
159  LandmarkContainerType m_LandmarkContainerToBeSet;
160 
161  TargetPointType m_TargetPoint;
162  TargetPointType m_TargetPointToBeSet;
163 
164  ErrorType m_LandmarkRegistrationError;
165  ErrorType m_LandmarkRegistrationErrorToBeSet;
166 
167  ErrorType m_TargetPointRegistrationError;
168 
170  itk::Matrix<double,3,3> m_LandmarkPrincipalAxes;
171 
174  VectorType m_RMSDistanceFromLandmarkToPrincipalAxes;
175 
177  LandmarkPointType m_LandmarkCentroid;
178 
179 };
180 } // end namespace igstk
181 
182 #endif // __igstkLandmark3DRegistrationErrorEstimator_h