CSplineParzenMI Class Reference

Implementation of mutual information based on B-splines. More...

#include <mia/core/splineparzenmi.hh>

Public Member Functions

 CSplineParzenMI (size_t rbins, PSplineKernel rkernel, size_t mbins, PSplineKernel mkernel, double cut_histogram)
 
template<typename MovIterator , typename RefIterator >
void fill (MovIterator mov_begin, MovIterator mov_end, RefIterator ref_begin, RefIterator ref_end)
 
template<typename MovIterator , typename RefIterator , typename MaskIterator >
void fill (MovIterator mov_begin, MovIterator mov_end, RefIterator ref_begin, RefIterator ref_end, MaskIterator mask_begin, MaskIterator mask_end)
 
double get_gradient (double moving, double reference) const
 
double get_gradient_slow (double moving, double reference) const
 
void reset ()
 
double value () const
 

Protected Member Functions

void fill_histograms (const std::vector< double > &values, double rmin, double rmax, double mmin, double mmax)
 

Detailed Description

Implementation of mutual information based on B-splines.

This class implements a spline parzen windows based evaluation of the mutual information between two images and its gradient w.r.t. to one image.

For details see P. Thévenaz, M. Unser, "Optimization of Mutual Information for Multiresolution Image Registration," IEEE Tran on Img Proc, vol. 9, no. 12, pp. 2083-2099, December 2000.

Definition at line 44 of file splineparzenmi.hh.

Constructor & Destructor Documentation

◆ CSplineParzenMI()

CSplineParzenMI::CSplineParzenMI ( size_t  rbins,
PSplineKernel  rkernel,
size_t  mbins,
PSplineKernel  mkernel,
double  cut_histogram 
)

Constructor of the mutual information class

Parameters
rbinsnumber of bins in reference intensity range
rkernelB-spline kernel for filling and evaluating reference intensities
mbinsnumber of bins in moving intensity range
mkernelB-spline kernel for filling and evaluating moving intensities
cut_histogramthe percentage of the histogram to clamp at the lower and upper end in order to eliminate outliers [0, 40]

Member Function Documentation

◆ fill() [1/2]

template<typename MovIterator , typename RefIterator >
void CSplineParzenMI::fill ( MovIterator  mov_begin,
MovIterator  mov_end,
RefIterator  ref_begin,
RefIterator  ref_end 
)

Fill the histogram structures and caches

Template Parameters
MovIteratorforward iterator type for moving image
RefIteratorforward iterator type for reference image
Parameters
mov_beginbegin of moving image range
mov_endend of moving image range
ref_beginbegin of reference image range
ref_endend of reference image range

Definition at line 178 of file splineparzenmi.hh.

References cvdebug().

◆ fill() [2/2]

template<typename MovIterator , typename RefIterator , typename MaskIterator >
void CSplineParzenMI::fill ( MovIterator  mov_begin,
MovIterator  mov_end,
RefIterator  ref_begin,
RefIterator  ref_end,
MaskIterator  mask_begin,
MaskIterator  mask_end 
)

Fill the histogram structures and caches by using a mask

Template Parameters
MovIteratorforward iterator type for moving image
RefIteratorforward iterator type for reference image
Parameters
mov_beginbegin of moving image range
mov_endend of moving image range
ref_beginbegin of reference image range
ref_endend of reference image range
mask_beginbegin of mask image range
mask_endend of mask image range

Definition at line 247 of file splineparzenmi.hh.

References cvdebug(), cvinfo(), THistogram< Feeder >::get_reduced_range(), NS_MIA_END, THistogram< Feeder >::push(), and THistogram< Feeder >::push_range().

◆ fill_histograms()

void CSplineParzenMI::fill_histograms ( const std::vector< double > &  values,
double  rmin,
double  rmax,
double  mmin,
double  mmax 
)
protected

these function is for test purpouses only

◆ get_gradient()

double CSplineParzenMI::get_gradient ( double  moving,
double  reference 
) const

Evaluate the gradient of the MI with respect to a given intensity pair using an approximation

Parameters
movingintensity in the moving image
referenceintensity in the moving image
Returns
gradient

◆ get_gradient_slow()

double CSplineParzenMI::get_gradient_slow ( double  moving,
double  reference 
) const

Evaluate the gradient of the MI with respect to a given intensity pair

Parameters
movingintensity in the moving image
referenceintensity in the moving image
Returns
gradient

◆ reset()

void CSplineParzenMI::reset ( )

reset the ranges to force a new evaluation

◆ value()

double CSplineParzenMI::value ( ) const
Returns
the value of the mutual information that is maximized if the given input images are equal.

The documentation for this class was generated from the following file: