Class RegistrationMeasureNormalizedMutualInformation

java.lang.Object
gov.nih.mipav.model.algorithms.registration.RegistrationMeasure
gov.nih.mipav.model.algorithms.registration.RegistrationMeasureNormalizedMutualInformation

public class RegistrationMeasureNormalizedMutualInformation extends RegistrationMeasure
Concrete implementation of the RegistrationMeasure class based on the normalized mutual information computed as follows:

H(X,Y) / (H(X) + H(Y))

where

- X and Y are the target and registered source images, respectively, or vice versa - H(X) and H(Y) are the standard marginal entropy definition where H(X) = - sum_i { p_i * log(p_i) } for probability p_i in histogram bin i - H(X,Y) is the joint entropy definition where H(X,Y) = - sum_ij { p_ij * log(p_ij) } for joint probability p_ij in histogram bin (i,j).

  • Field Details

    • s_adIntLog

      protected static double[] s_adIntLog
      Table with precalculated logarithms.
    • m_aiBinReg

      protected int[] m_aiBinReg
      Bins used to hold the histograms.
    • m_aiBinRegTrg

      protected int[] m_aiBinRegTrg
      DOCUMENT ME!
    • m_aiImageBinReg

      protected int[] m_aiImageBinReg
      Image corresponding to the samples in the registered source image which identifies to which bin the sample belongs. This is a linear storage for a 2D array where iBinReg and iBinTrg map to the 1D index by computing iBinReg*m_iNumBins+iBinTrg.
    • m_aiImageBinTrg

      protected int[] m_aiImageBinTrg
      Image corresponding to the samples in the target image which identifies to which bin the sample belongs.
    • m_dEntropyImageTrg

      protected double m_dEntropyImageTrg
      Precomputed entropy for the target image.
    • m_fSrcMin

      protected float m_fSrcMin
      Given a value in the registered source image, these values are used in this equation to determine the actual histogram bin: int iBinReg = (int)((value - m_fSrcMin) * m_fSrcScale);.
    • m_fSrcScale

      protected float m_fSrcScale
      DOCUMENT ME!
    • m_iNumBins

      protected int m_iNumBins
      Number of bins to use for computation.
  • Constructor Details

    • RegistrationMeasureNormalizedMutualInformation

      public RegistrationMeasureNormalizedMutualInformation()
      Constructor which sets up for a default number of bins.
    • RegistrationMeasureNormalizedMutualInformation

      public RegistrationMeasureNormalizedMutualInformation(int iNumBins)
      Constructor.
      Parameters:
      iNumBins - int Number of bins to use for computation.
  • Method Details

    • getStaticName

      public static String getStaticName()
      Return the name of the particular registration measure without having an instance.
      Returns:
      String Contains the name of the particular registration measure.
    • createNew

      public RegistrationMeasure createNew()
      Create a new instance of this measure. That is, the same type and having the same properties. But initially, the target is not defined.
      Specified by:
      createNew in class RegistrationMeasure
      Returns:
      RegistrationMeasure Newly created instance.
    • getError

      public double getError()
      Return the current error measure between the target image and the registered source image.
      Specified by:
      getError in class RegistrationMeasure
      Returns:
      double Error measure value. Minimum value is zero. Maximum value depends on the range of values in the target and registered source images.
    • getName

      public String getName()
      Return the name of the particular registration measure.
      Specified by:
      getName in class RegistrationMeasure
      Returns:
      String Contains the name of the particular registration measure.
    • setImages

      public void setImages(ModelSimpleImage kImageSrc, ModelSimpleImage kImageTrg)
      Setup the measure to use information from the target image and the original source image. Each derived class override of this method must call this method.
      Overrides:
      setImages in class RegistrationMeasure
      Parameters:
      kImageSrc - ModelSimpleImage Contains information and data about the original source image. This array may be empty but not null.
      kImageTrg - ModelSimpleImage Contains information and data about yhe target image. This array may be empty but not null.
    • updateRegistration

      public void updateRegistration(int iIndex, float fNewValue)
      Update the specified value in the registered source image. Causes a change in the computed error measure.
      Specified by:
      updateRegistration in class RegistrationMeasure
      Parameters:
      iIndex - int Linear array index for the value to be updated.
      fNewValue - float New registered source image value to store at the specified index.
    • getEntropy

      protected static double getEntropy(int[] aiHistBin, double dNumSamples)
      Standard entropy calculation.
      Parameters:
      aiHistBin - int[] Array of histogram bins. The sum of the the values in each of the array positions should equal the values passed in iNumSamples.
      dNumSamples - double Total number of samples in the distribution. Must be a double-precision floating point number because the number can be quite large in the case of the joint entropy.
      Returns:
      double Computed entropy value.
    • getTableIntLog

      protected static double[] getTableIntLog()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!