zxhproj v 2.2
zxhproj
|
00001 00002 /*========================================================================= 00003 00004 Program: ZXH Registration Software 00005 Author: Xiahai Zhuang 00006 Module: $RCSfle: zxhMetricMIFFD2.h $ 00007 Language: C++ 00008 Date: $Date: From 2008-10 $ 00009 Version: $Revision: 2.0 $ 00010 revision: 00011 =========================================================================*/ 00012 #ifndef zxhMetricMIFFD2_h 00013 #define zxhMetricMIFFD2_h 00014 00015 #include "zxh.h" 00016 #include <time.h> 00017 #include "zxhMetricFFD2Base.h" 00018 #include "zxhMetricMIConstraint.h" 00019 #include "zxhImageGipl.h" 00020 #include <math.h> 00030 class zxhMetricMIFFD2 : public zxhMetricMIConstraint, 00031 public zxhMetricFFD2Base // interface for FFD2 00032 { 00033 public: 00035 zxhMetricMIFFD2(void); 00037 ~zxhMetricMIFFD2(void); 00038 00040 virtual std::string GetMetricType() {return zxhMetricMIConstraint::GetMetricType()+"_"+zxhMetricFFD2Base::GetMetricType(); } ; 00041 00043 virtual zxhMetricBase* Clone( zxhMetricBase * & pRet ); 00045 virtual int GetValue( zxhlfloat & fvalue ) ; 00046 00049 virtual int ComputeHistogramFromPDF4D(zxhlfloat * &afPDF,zxhlfloat&fTotalFreq, 00050 float xfTestFrom,float xfTestTo,float yfTestFrom,float yfTestTo, 00051 float zfTestFrom,float zfTestTo,float tfTestFrom,float tfTestTo); 00053 virtual int ComputeConstanceForFFDGradient() ; 00054 00056 virtual void SetAlwaysUpdateGetValue( bool b ) {m_bAlwaysUpdateGetValue=b;}; 00058 virtual bool GetAlwaysUpdateGetValue( void ) {return m_bAlwaysUpdateGetValue;}; 00059 00060 protected: 00062 virtual void SetFFDMetricBase() {m_pMetricBase=this;}; 00069 virtual void EvaluateOnPixelSource2TargetForce( zxhlfloat *afForce, int iLengthOfHistogramDim, 00070 const float * gridCoTest, const float * gridCoRef ) const ; 00071 00072 /*** methods for ComputeConstanceForFFDGradient ***/ 00078 00079 00080 00083 virtual bool EvaluateAllPixelOnTargetForceForMetric(); 00084 00085 00089 bool m_bAlwaysUpdateGetValue ; 00093 //virtual bool ComputeAllControlPointDerivativeBySumLocalEstimation(); 00096 // virtual int GetDiffByFFDGrid(float * afPD, // output partial differentiation 00097 // zxhTransformFFDBase * pFFDGrid, 00098 // int * aiCtrPnt, 00099 // zxhTransformFFDBase * pDifferential ) 00100 // {return this->GetDerivativeFFDGrid(afPD,pFFDGrid,aiCtrPnt,pDifferential); } ; 00101 // /// 00102 // virtual int GetDerivativeFFDGrid(float * afPD, // output partial differentiation 00103 // zxhTransformFFDBase * pFFDGrid, 00104 // int * aiCtrPnt, 00105 // zxhTransformFFDBase * pDifferential); 00106 }; 00107 00108 #endif 00109 00110 00111 00112