registration
Class SearchMI

java.lang.Object
  extended by bijnum.BIJmi
      extended by registration.SearchMI
All Implemented Interfaces:
numericalMethods.function.nmDoubleArrayParametrized, numericalMethods.function.nmDoubleValued

public class SearchMI
extends BIJmi
implements numericalMethods.function.nmDoubleArrayParametrized, numericalMethods.function.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
           
 double[] p
          The parameters that can be set by setDoubleArrayParameter.
 int width
           
 
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).
 void setDoubleArrayParameter(double[] p, int offset)
          Required because implements nmDoubleArrayParametrized.
 
Methods inherited from class bijnum.BIJmi
getBins, getJointHistogram, getNiceScale, getScale, mi, mi
 
Methods inherited from class java.lang.Object
equals, 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.

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: numericalMethods.function.nmDoubleArrayParametrized
Get the length of the double array parameter.

Specified by:
getDoubleArrayParameterLength in 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 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 numericalMethods.function.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