zxhproj v 2.2
zxhproj

zxhMetricMI Class Reference

(normalized) mutual information based on histogram or parzen window default is normalised mi and histogram gray level preprocess and PDF estimation weight pixel added 1. set test / ref image 2. set sample physical -> sample interval 3. compute similarity: 1) For SEMI/MMI +++++ resample test image -> sample physical ++++++ IMPORTANT (for FFD registration to use pre-transform) 2) reset sample interval More...

#include <zxhMetricMI.h>

Inheritance diagram for zxhMetricMI:
zxhMetricBase zxhMetricMIConstraint zxhMetricMIFFD zxhMetricMIFFD2 zxhMetricMILocalAffines zxhMetricMIMultiImage zxhMetricMIFFDSEMI zxhMetricMIFFD2ConstDiscretePath zxhMetricMIFFD2MultiImage

List of all members.

Public Member Functions

 zxhMetricMI (void)
 constructor
 ~zxhMetricMI (void)
virtual std::string GetMetricType ()
 GetMetricType()=0.
virtual zxhMetricBaseClone (zxhMetricBase *&pRet)
virtual bool PreComputeImageGraylevel ()
 pre-computation for Image GraySpan before using this object, this make the method better
virtual bool SetImage (zxhImageData *pImageTest, zxhImageData *pImageRef)
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 ComputeHistogramMaskRegionOnTest (zxhImageData *pMask, zxhlfloat *&afPDF, zxhlfloat &fFreq)
 within roi
virtual int ComputeHistogram (zxhlfloat *&afHistogram, zxhlfloat &fTotalFreq)
virtual int GetValue (zxhlfloat &fValue)
virtual zxhlfloat GetMIValue (const zxhlfloat *afHistogram, const zxhlfloat fTotalFreq)
virtual void AddHistogram (zxhlfloat *afHistogramDes, const zxhlfloat *afHistogramSrc, int times=1)
virtual void GetAddHistogram (zxhlfloat *afHistogramDes, zxhlfloat *afHistogramSrc1, zxhlfloat *afHistogramSrc2)
void SetNumberOfHistogramBins (int i=32)
int GetNumberOfHistogramBins ()
void SetPDFType (enum zxh::TypeHistogramCompute i)
void SetMMILambda (float f)
float GetMMILambda ()
void SetMMISamplePhysical (float *f)
const float * GetMMISamplePhysical ()
void SetMMILocalRegionSizeInMM (float f)
void SetMMIKernelType (enum zxh::TypeSEMIKernelFunction type)
void SetMMI (bool b)
bool GetIsMMI ()
void SetMIType (enum zxh::TypeMutualInformation i)
enum zxh::TypeMutualInformation GetMIType ()
virtual std::string GetPrintString ()
virtual bool SetMetricFromStream (std::ifstream &ifs)
virtual int ComputeConstanceForGradient ()

Static Public Attributes

static const int m_stc_iPaddedBins = BSplineHistogramPaddingBins
 padded bin for the parzen windows

Protected Member Functions

float SEMIKernelDistanceToWeight (float dis)
int GetLengthOfHistogramDim ()
void IntensityBoundBk (float &gray, const short aiImageGraySpan[]) const
void IntensityBoundBk (zxhlfloat &gray, const short aiImageGraySpan[]) const
void IntensityBound (zxhlfloat &gray, const short aiImageGraySpan[]) const
void IntensityBound (float &gray, const short aiImageGraySpan[]) const
virtual void EvaluateOnJointHistogram (zxhlfloat &fTotalFreq, zxhlfloat *afPDF, int iLengthOfHistogramDim, zxhlfloat fGrayTest, zxhlfloat fGrayRef, zxhlfloat weight=1)
 evaluate the contribution of current pixel pair to the joint histogram table
virtual void EvaluateOnPixelSource2TargetForce (zxhlfloat *afForce, int iLengthOfHistogramDim, const float *gridCoTest, const float *gridCoRef) const
 sumup (1+log p)*w_l(I_t)*dw_k(I_s)*dI_s/d(T) without -1/N (have not test yet), NOT USED NOW
float BSplinei (int iOrd, float u)
float DerivativeOfBSplinei (int iOrd, float u)
zxhlfloat ComputMMILocalRegionPDFValue (zxhlfloat *afHistL, zxhlfloat &fVl, const zxhlfloat *afHistG, const zxhlfloat fVg)
 MixtureMI fVg = fVALL-fVl.
void EvaluateMMIpositionWeightedHistogram (int *roiFrom, int *roiTo, float *WorldCentre, zxhlfloat *afHistogram, zxhlfloat &fTotalFreq, int *excludeFrom, int *excludeTo)
void EvaluateMMIpositionWeightedHistogram (int *roiFrom, int *roiTo, float *WorldCentre, zxhlfloat *afHistogram, zxhlfloat &fTotalFreq, zxhImageData *pExcludeImageMask)

Protected Attributes

enum zxh::TypeMutualInformation m_iComputePDType
float m_fMMILambda
float m_afMMISamplePhysical [ImageDimensionMax]
float m_fMMILocalRegionSizeInMM
 mm local region size = 6*gausian sigma, 4*bspline spacing
enum zxh::TypeSEMIKernelFunction m_iMMIKernelType
zxhImageData m_imgMMItestImage
zxhImageData m_imgMMIrefImage
zxhImageDataT< float > m_imgMMIWeighttestref
enum zxh::TypeHistogramCompute m_iPDFType
enum zxh::TypeMutualInformation m_iMIType
int m_iNumberOfHistogramBins
PixelTypeDefault m_aiImageTestGraySpan [2]
 for test image gray level min and max
PixelTypeDefault m_aiImageRefGraySpan [2]
 for ref image gray level min and max
zxhlfloat m_fBinSizeTestImage
zxhlfloat m_fBinSizeRefImage
zxhlfloat m_fEntropyT
zxhlfloat m_fEntropyR
zxhlfloat m_fEntropyJ
zxhlfloat m_fMutualInformation
zxhlfloat m_fNormalisedMutualInformation
zxhlfloat * m_afPDFt
 probability distribution function
zxhlfloat * m_afPDFr
zxhlfloat * m_afPDFj
zxhlfloat * m_afHistogram
zxhlfloat m_fTotalFreq
zxhlfloat * m_afC_Ht
zxhlfloat * m_afC_Hr
zxhlfloat * m_afC_Hj

Detailed Description

(normalized) mutual information based on histogram or parzen window default is normalised mi and histogram gray level preprocess and PDF estimation weight pixel added 1. set test / ref image 2. set sample physical -> sample interval 3. compute similarity: 1) For SEMI/MMI +++++ resample test image -> sample physical ++++++ IMPORTANT (for FFD registration to use pre-transform) 2) reset sample interval


Constructor & Destructor Documentation

zxhMetricMI::~zxhMetricMI ( void  )
Returns:

Member Function Documentation

float zxhMetricMI::BSplinei ( int  iOrd,
float  u 
) [inline, protected]
Returns:
int zxhMetricMI::ComputeHistogramFromPDF4D ( zxhlfloat *&  afPDF,
zxhlfloat &  fTotalFreq,
float  xfTestFrom,
float  xfTestTo,
float  yfTestFrom,
float  yfTestTo,
float  zfTestFrom,
float  zfTestTo,
float  tfTestFrom,
float  tfTestTo 
) [virtual]

Considier checking: Mask images, within Ref image volume, NOT checking, ROI DO NOT assume Test image be resampled into WorldInterval spacing 2010-08-27 update, use model to get gray value for test image as well

Considier checking: Mask images, within Ref image volume, NOT checking, ROI DO NOT assume Test image be resampled into WorldInterval spacing 2010-08-27 update, use model to get gray value for test image as well x/y/z/tfTestFrom/To: is TestImageGrid coordinate

Reimplemented in zxhMetricMIFFD2.

float zxhMetricMI::DerivativeOfBSplinei ( int  iOrd,
float  u 
) [inline, protected]
Returns:
derivative of cubic spline kenel function
void zxhMetricMI::EvaluateOnPixelSource2TargetForce ( zxhlfloat *  afForce,
int  iLengthOfHistogramDim,
const float *  gridCoTest,
const float *  gridCoRef 
) const [protected, virtual]

sumup (1+log p)*w_l(I_t)*dw_k(I_s)*dI_s/d(T) without -1/N (have not test yet), NOT USED NOW

Based on CrumIPMI03's idea but the test image is regarded as the source image now, NOT USED NOW CrumIPMI03's idea, the force to transform source image toward target, Not use weight,

Reimplemented in zxhMetricMIFFD2.

int zxhMetricMI::GetNumberOfHistogramBins ( ) [inline]
Returns:
std::string zxhMetricMI::GetPrintString ( ) [virtual]
Returns:

Reimplemented from zxhMetricBase.

int zxhMetricMI::GetValue ( zxhlfloat &  fValue) [virtual]
Returns:
similarity and number of computed pixel pair

Implements zxhMetricBase.

Reimplemented in zxhMetricMIConstraint, zxhMetricMIFFD, zxhMetricMIFFD2, zxhMetricMIFFD2MultiImage, zxhMetricMIFFDSEMI, and zxhMetricMIMultiImage.

bool zxhMetricMI::SetImage ( zxhImageData pImageTest,
zxhImageData pImageRef 
) [virtual]
Returns:
1)2)3); 4) PreComputeImageGraylevel

Reimplemented in zxhMetricMIFFD2ConstDiscretePath, zxhMetricMIFFD2MultiImage, and zxhMetricMIMultiImage.

bool zxhMetricMI::SetMetricFromStream ( std::ifstream &  ifs) [virtual]
Returns:

Reimplemented from zxhMetricBase.

void zxhMetricMI::SetMIType ( enum zxh::TypeMutualInformation  i) [inline]
Returns:
void zxhMetricMI::SetNumberOfHistogramBins ( int  i = 32) [inline]
Returns:
void zxhMetricMI::SetPDFType ( enum zxh::TypeHistogramCompute  i) [inline]
Returns:

Member Data Documentation

zxhlfloat* zxhMetricMI::m_afC_Hj [protected]
Returns:
zxhlfloat* zxhMetricMI::m_afC_Hr [protected]
Returns:
zxhlfloat* zxhMetricMI::m_afC_Ht [protected]
Returns:
compute (1+log(A+B)) for each (l,k) into m_afC_Hr, m_afC_Ht, m_afC_Hj
zxhlfloat* zxhMetricMI::m_afHistogram [protected]
Returns:
zxhlfloat* zxhMetricMI::m_afPDFj [protected]
Returns:
zxhlfloat* zxhMetricMI::m_afPDFr [protected]
Returns:
zxhlfloat zxhMetricMI::m_fEntropyJ [protected]
Returns:
zxhlfloat zxhMetricMI::m_fEntropyR [protected]
Returns:
zxhlfloat zxhMetricMI::m_fEntropyT [protected]
Returns:
enum zxh::TypeMutualInformation zxhMetricMI::m_iComputePDType [protected]
Returns:
Mixture probability
enum zxh::TypeMutualInformation zxhMetricMI::m_iMIType [protected]
Returns:
Returns:
enum zxh::TypeHistogramCompute zxhMetricMI::m_iPDFType [protected]
Returns:
LinearHistorgram, PVHistogram, LinearPW, PVPW

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs