zxhproj v 2.2
zxhproj
|
MIconstraint + FFD2 GetValue: call PreComputeTransformField assume this : ComputeConstanceForFFDGradient will resample testimage using m_afSamplingPhysical can do line-search in optimization, however line-search time consuming, NOT used not SIEMI. More...
#include <zxhMetricMIFFD2.h>
Public Member Functions | |
zxhMetricMIFFD2 (void) | |
constructor | |
~zxhMetricMIFFD2 (void) | |
virtual std::string | GetMetricType () |
virtual zxhMetricBase * | Clone (zxhMetricBase *&pRet) |
virtual int | GetValue (zxhlfloat &fvalue) |
virtual int | ComputeHistogramFromPDF4D (zxhlfloat *&afPDF, zxhlfloat &fTotalFreq, float xfTestFrom, float xfTestTo, float yfTestFrom, float yfTestTo, float zfTestFrom, float zfTestTo, float tfTestFrom, float tfTestTo) |
virtual int | ComputeConstanceForFFDGradient () |
pre compute: | |
virtual void | SetAlwaysUpdateGetValue (bool b) |
virtual bool | GetAlwaysUpdateGetValue (void) |
Protected Member Functions | |
virtual void | SetFFDMetricBase () |
this function is to remind of setting m_pMetricBase in non-abstract derived class | |
virtual void | EvaluateOnPixelSource2TargetForce (zxhlfloat *afForce, int iLengthOfHistogramDim, const float *gridCoTest, const float *gridCoRef) const |
virtual bool | EvaluateAllPixelOnTargetForceForMetric () |
Protected Attributes | |
bool | m_bAlwaysUpdateGetValue |
MIconstraint + FFD2 GetValue: call PreComputeTransformField assume this : ComputeConstanceForFFDGradient will resample testimage using m_afSamplingPhysical can do line-search in optimization, however line-search time consuming, NOT used not SIEMI.
zxhMetricMIFFD2::~zxhMetricMIFFD2 | ( | void | ) |
zxhMetricBase * zxhMetricMIFFD2::Clone | ( | zxhMetricBase *& | pRet | ) | [virtual] |
Reimplemented from zxhMetricMIConstraint.
Reimplemented in zxhMetricMIFFD2ConstDiscretePath, and zxhMetricMIFFD2MultiImage.
int zxhMetricMIFFD2::ComputeHistogramFromPDF4D | ( | zxhlfloat *& | afPDF, |
zxhlfloat & | fTotalFreq, | ||
float | xfTestFrom, | ||
float | xfTestTo, | ||
float | yfTestFrom, | ||
float | yfTestTo, | ||
float | zfTestFrom, | ||
float | zfTestTo, | ||
float | tfTestFrom, | ||
float | tfTestTo | ||
) | [virtual] |
1) To reimplement this func in zxhMetricMI, in order to use TransformPointToWorldUsingPreComputed 2) assumes sample physical = test image sp = pre-transform field image sp
Reimplemented from zxhMetricMI.
bool zxhMetricMIFFD2::EvaluateAllPixelOnTargetForceForMetric | ( | ) | [protected, virtual] |
Call 1. EvaluateOnPixelOnTargetForce for NMI 2. 3. ComputeAllControlPointDerivativeBySumLocalEstimation 4. AddAllCtrPntOnTargetForceForBendingEnergy adding the bending energy force to -> m_pCtrPntDerivativeConst 1. call EvaluateOnPixelSource2TargetForce to compute each voxel and minus the force direction 2. add weight info from m_pWeightModelTest(Ref)
1. call EvaluateOnPixelSource2TargetForce to compute each voxel and minus the force direction (test image sp = sampling = pre-transform sp = voxel force const sp) 2. add weight info from m_pWeightModelTest(Ref)
Implements zxhMetricFFD2Base.
void zxhMetricMIFFD2::EvaluateOnPixelSource2TargetForce | ( | zxhlfloat * | afForce, |
int | iLengthOfHistogramDim, | ||
const float * | gridCoTest, | ||
const float * | gridCoRef | ||
) | const [protected, virtual] |
CrumIPMI03's idea, the force to transform source image toward target using parzen window PDF estimation, only give NMI derivatves 1. ComputeConstanceForGradient() called with m_afC_H? and m_afFreqTotal, m_fNormalisedMutualInformation, m_fEntropyJ 2. gridCoTest are integral 3. DHist/du = sum_{all (x,y) related p()}(1+logp)Dp/du ; sum_{all (x,y) related p()} = sum_{-2,2bspline p()} 4. Dp()_{x,y}/du = Bspline(It(x))Dbspline(Ir(y))GradientRef(y)[]*(1/Binsize), 1/Binsize is omitted 5. The weight info from m_pWeightModelTest(Ref) should be computed here, however to improve the computation, we include that in EvaluateAllPixelOnTargetForceForNMI
1. ComputeConstanceForGradient() called with m_afC_H? and m_afFreqTotal 2. gridCoTest are integral 3. DHist/du = sum_{all (x,y) related p()}(1+logp)Dp/du ; sum_{all (x,y) related p()} = sum_{-2,2bspline p()} 4. Dp()_{x,y}/du = 1/(fTotalFreq)* Bspline(It(x))Dbspline(Ir(y))GradientRef(y)[]*(1/Binsize), NOTE some softwares do not have 1/Binsize because they normalized the image intensity using the binsize this in effect is equivalent to ours because they will result in using 1/Binsize in the image gradient values.
Reimplemented from zxhMetricMI.
int zxhMetricMIFFD2::GetValue | ( | zxhlfloat & | fValue | ) | [virtual] |
Reimplemented from zxhMetricMIConstraint.
Reimplemented in zxhMetricMIFFD2MultiImage.
bool zxhMetricMIFFD2::m_bAlwaysUpdateGetValue [protected] |
in gradient descent optimization, ComputeConstanceForFFDGradient is called and metric value has been computed therefore, unless m_bAlwaysUpdateGetValue is set to true, GetValue should not recompute the metric again default: true