registration
Class SearchMI

java.lang.Object
  |
  +--bijnum.BIJmi
        |
        +--registration.SearchMI
All Implemented Interfaces:
nmDoubleArrayParametrized, nmDoubleValued

public class SearchMI
extends BIJmi
implements nmDoubleArrayParametrized, nmDoubleValued

This class extends BIJmi to provide hooks for the numericalMethods minimization routines package. Copyright (c) 1999-2003, Michael Abramoff. All rights reserved.


Field Summary
 float[] a
          Two images.
 float[] b
           
 int cycles
           
protected  double minMI
           
protected  double[] minp
           
 double[] p
          The parameters that can be set by setDoubleArrayParameter.
 int width
           
 
Fields inherited from class bijnum.BIJmi
bins, min, n, Pu, Puv, Pv, scale
 
Constructor Summary
SearchMI(float min, float max, float scale, float[] a, float[] b, int width)
          Create a new MI search object for images a and b.
 
Method Summary
 double getAbsoluteMinimumMI()
          Return the absolute minimal MI found along the search.
 double[] getAbsoluteMinimumParameters()
          Return the parameters corresponding to the absolute minimal MI found along the search.
 int getDoubleArrayParameterLength()
          Get the length of the double array parameter.
 double getDoubleValue()
          Required because this class implements nmDoubleValued.
 double mi(double[] p)
          Compute the mutual information of images a and (b transformed according to p).
 float mi(float[] p)
          Compute the mutual information of images a and (b transformed according to p).
protected  float mi(float[] a, float[] b, int width, float[][] m)
          Compute mutual information of the common parts of the transformation of image b and a.
 void setDoubleArrayParameter(double[] p, int offset)
          Required because implements nmDoubleArrayParametrized.
 
Methods inherited from class bijnum.BIJmi
computeProbs, getBins, getJointHistogram, getNiceScale, getScale, mi, mi, zeroHistograms
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a

public float[] a
Two images.

b

public float[] b

width

public int width

cycles

public int cycles

p

public double[] p
The parameters that can be set by setDoubleArrayParameter. p[0] = x translation p[1] = y translation p[2] = rotation in degrees p[3] = x scaling factor p[4] = y scaling factor.

minp

protected double[] minp

minMI

protected double minMI
Constructor Detail

SearchMI

public SearchMI(float min,
                float max,
                float scale,
                float[] a,
                float[] b,
                int width)
Create a new MI search object for images a and b. b will be transformed to have the best correspondence with a.
Method Detail

getDoubleArrayParameterLength

public int getDoubleArrayParameterLength()
Description copied from interface: nmDoubleArrayParametrized
Get the length of the double array parameter.
Specified by:
getDoubleArrayParameterLength in interface nmDoubleArrayParametrized
Following copied from interface: numericalMethods.function.nmDoubleArrayParametrized
Returns:
the length of the double array parameter.

setDoubleArrayParameter

public void setDoubleArrayParameter(double[] p,
                                    int offset)
Required because implements nmDoubleArrayParametrized.
Specified by:
setDoubleArrayParameter in interface nmDoubleArrayParametrized
Following copied from interface: numericalMethods.function.nmDoubleArrayParametrized
Parameters:
p - a double[] whith length at least offset+len holding the values to which the double array parameter is set.
offset - the position in p where the double array parameter is read from.

getDoubleValue

public double getDoubleValue()
Required because this class implements nmDoubleValued. Return the MI of a and the transformed b using the parameters set in p. It needs class variables p, a, b, and width.
Specified by:
getDoubleValue in interface nmDoubleValued
Returns:
the mutual information of a and b transformed by p.

mi

public double mi(double[] p)
Compute the mutual information of images a and (b transformed according to p). Needs a, b, width.
Parameters:
p - a double[] with the transformation parameters.
Returns:
the MI.
See Also:
Transformer

getAbsoluteMinimumMI

public double getAbsoluteMinimumMI()
Return the absolute minimal MI found along the search.

getAbsoluteMinimumParameters

public double[] getAbsoluteMinimumParameters()
Return the parameters corresponding to the absolute minimal MI found along the search.

mi

public float mi(float[] p)
Compute the mutual information of images a and (b transformed according to p). Needs a, b, width.
Parameters:
p - a float[] with the transformation parameters.
Returns:
the MI.
See Also:
Transformer

mi

protected float mi(float[] a,
                   float[] b,
                   int width,
                   float[][] m)
Compute mutual information of the common parts of the transformation of image b and a. Can process masked images, where non-valid pixels have been set to NaN.
Parameters:
a - a float[] image
b - a float[] image
width - the width of the images.
m - the transformation matrix for b.