IGSTK
|
00001 /*========================================================================= 00002 00003 Program: Image Guided Surgery Software Toolkit 00004 Module: $RCSfile: igstkLandmark3DRegistrationErrorEstimator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2008-06-05 14:54:59 $ 00007 Version: $Revision: 1.12 $ 00008 00009 Copyright (c) ISC Insight Software Consortium. All rights reserved. 00010 See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef __igstkLandmark3DRegistrationErrorEstimator_h 00019 #define __igstkLandmark3DRegistrationErrorEstimator_h 00020 00021 #include "igstkStateMachine.h" 00022 #include "igstkMacros.h" 00023 #include "igstkObject.h" 00024 #include "igstkEvents.h" 00025 #include "itkPoint.h" 00026 #include "itkVersor.h" 00027 #include <vector> 00028 00029 namespace igstk 00030 { 00049 class Landmark3DRegistrationErrorEstimator : public Object 00050 { 00051 00052 public: 00053 00055 igstkStandardClassTraitsMacro( Landmark3DRegistrationErrorEstimator, Object ) 00056 00057 public: 00058 00060 typedef itk::Point<double, 3> TargetPointType; 00061 typedef itk::Point<double, 3> LandmarkPointType; 00062 typedef std::vector< LandmarkPointType > LandmarkContainerType; 00063 00065 typedef double ErrorType; 00066 00068 void RequestSetLandmarkContainer( const LandmarkContainerType & ); 00069 00071 void RequestSetTargetPoint ( const TargetPointType & ); 00072 00074 void RequestSetLandmarkRegistrationError ( const ErrorType & ); 00075 00077 void RequestEstimateTargetPointRegistrationError( ); 00078 00080 void RequestGetTargetPointRegistrationErrorEstimate(); 00081 00082 protected: 00083 00084 Landmark3DRegistrationErrorEstimator ( void ); 00085 ~Landmark3DRegistrationErrorEstimator ( void ); 00086 00088 void PrintSelf( std::ostream& os, itk::Indent indent ) const; 00089 00090 private: 00091 00092 typedef itk::Vector<double, 3> VectorType; 00093 typedef LandmarkContainerType::const_iterator PointsContainerConstIterator; 00094 typedef double DistanceType; 00095 typedef itk::Versor<double> VersorType; 00096 00097 00099 void ComputeLandmarksCentroid(); 00100 00102 void ComputeLandmarkPrincipalAxes(); 00103 00105 void ComputeRMSDistanceLandmarksFromPrincipalAxes(); 00106 00108 void SetLandmarkContainerProcessing(); 00109 00111 void SetTargetPointProcessing(); 00112 00114 void SetLandmarkRegistrationErrorProcessing( ); 00115 00116 void ComputeErrorParameters( ); 00117 00119 void EstimateTargetPointRegistrationErrorProcessing( ); 00120 00122 void ReportInvalidRequestProcessing(); 00123 00125 void ReportSuccessInTargetPointRegistrationErrorEstimationProcessing(); 00126 00128 void ReportFailureInTargePointRegistrationErrorEstimationProcessing(); 00129 00132 void GetTargetPointRegistrationErrorEstimateProcessing(); 00133 00135 igstkDeclareStateMacro( Idle ); 00136 igstkDeclareStateMacro( LandmarkContainerSet ); 00137 igstkDeclareStateMacro( LandmarkRegistrationErrorSet ); 00138 igstkDeclareStateMacro( TargetPointSet ); 00139 igstkDeclareStateMacro( AttemptingToEstimateTargetRegstirationError ); 00140 igstkDeclareStateMacro( TargetRegistrationErrorEstimated ); 00141 00142 00144 igstkDeclareInputMacro( LandmarkContainer ); 00145 igstkDeclareInputMacro( LandmarkRegistrationError ); 00146 igstkDeclareInputMacro( TargetPoint ); 00147 igstkDeclareInputMacro( EstimateTargetPointRegistrationError ); 00148 igstkDeclareInputMacro( TargetPointRegistrationErrorEstimationSuccess ); 00149 igstkDeclareInputMacro( TargetPointRegistrationErrorEstimationFailure ); 00150 igstkDeclareInputMacro( GetTargetPointRegistrationErrorEstimate ); 00151 00152 00155 Landmark3DRegistrationErrorEstimator(const Self&); //purposely not implemented 00156 void operator=(const Self&); //purposely not implemented 00157 00158 LandmarkContainerType m_LandmarkContainer; 00159 LandmarkContainerType m_LandmarkContainerToBeSet; 00160 00161 TargetPointType m_TargetPoint; 00162 TargetPointType m_TargetPointToBeSet; 00163 00164 ErrorType m_LandmarkRegistrationError; 00165 ErrorType m_LandmarkRegistrationErrorToBeSet; 00166 00167 ErrorType m_TargetPointRegistrationError; 00168 00170 itk::Matrix<double,3,3> m_LandmarkPrincipalAxes; 00171 00174 VectorType m_RMSDistanceFromLandmarkToPrincipalAxes; 00175 00177 LandmarkPointType m_LandmarkCentroid; 00178 00179 }; 00180 } // end namespace igstk 00181 00182 #endif // __igstkLandmark3DRegistrationErrorEstimator_h