CSplineParzenMI Class Reference
Image Registration and Transformation

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

  rbins | number of bins in reference intensity range
  rkernel | B-spline kernel for filling and evaluating reference intensities
  mbins | number of bins in moving intensity range
  mkernel | B-spline kernel for filling and evaluating moving intensities
  cut_histogram | the percentage of the histogram to clamp at the lower and upper end in order to eliminate outliers [0, 40]

References fill().

Referenced by fill().

## 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

  MovIterator | forward iterator type for moving image
  RefIterator | forward iterator type for reference image

Parameters

  mov_begin | begin of moving image range
  mov_end | end of moving image range
  ref_begin | begin of reference image range
  ref_end | end of reference image range

Definition at line 179 of file splineparzenmi.hh.

References CSplineParzenMI(), cvdebug(), and fill().

Referenced by CSplineParzenMI(), fill(), and fill().

## 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

  MovIterator | forward iterator type for moving image
  RefIterator | forward iterator type for reference image

Parameters

  mov_begin | begin of moving image range
  mov_end | end of moving image range
  ref_begin | begin of reference image range
  ref_end | end of reference image range
  mask_begin | begin of mask image range
  mask_end | end of mask image range

Definition at line 249 of file splineparzenmi.hh.

References cvdebug(), and fill().

## 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

  moving | intensity in the moving image
  reference | intensity 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

  moving | intensity in the moving image
  reference | intensity 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:

- splineparzenmi.hh