Class RegistrationMeasureCorrelationRatio


  • public class RegistrationMeasureCorrelationRatio
    extends RegistrationMeasure
    Concrete implementation of the RegistrationMeasure class based on the correlation ratio computed as follows:

    sum_k { variance(Y_k) * n_k / N } / variance(Y)

    where - X is the target image - Y is the registered source image - N is the total number of samples - k is in the range [0,nbins) - variance(Y) is the variances for every sample in the image Y - variance(Y_k) is the variance of the k-th iso-set defined as the set of intensities in image Y at positions where the intensity in image X is in the k-th intensity bin - n_k is the number of samples in the k-th iso-set

    The cummulative summations used to compute the variances are maintained along with the index of the corresponding bin for each sample.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double[] m_adBinSum1
      Sum of the intensities in bin.
      protected double[] m_adBinSum2
      Sum of the squared intensities in bin.
      protected int[] m_aiBinSum0
      Bins used to hold cummulative summations for computing the variances.
      protected int[] m_aiImageBin
      Image corresponding to the samples in the target image which identifies to which bin the sample belongs.
      protected double m_dSum1
      DOCUMENT ME!
      protected double m_dSum2
      DOCUMENT ME!
      protected int m_iNumBins
      Number of bins to use for computation.
      protected int m_iSum0
      Cummulative summations for computing the total variance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RegistrationMeasure createNew()
      Create a new instance of this measure.
      double getError()
      Return the current error measure between the target image and the registered source image.
      java.lang.String getName()
      Return the name of the particular registration measure.
      static java.lang.String getStaticName()
      Return the name of the particular registration measure without having an instance.
      protected static double getVariance​(int N, double dSum1, double dSum2)
      Compute the variance given the total number of samples along with the sum of values and sum of squared values.
      void setImages​(ModelSimpleImage kImageSrc, ModelSimpleImage kImageTrg)
      Setup the measure to use information from the target image and the original source image.
      void updateRegistration​(int iIndex, float fNewValue)
      Update the specified value in the registered source image.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_adBinSum1

        protected double[] m_adBinSum1
        Sum of the intensities in bin.
      • m_adBinSum2

        protected double[] m_adBinSum2
        Sum of the squared intensities in bin.
      • m_aiBinSum0

        protected int[] m_aiBinSum0
        Bins used to hold cummulative summations for computing the variances.
      • m_aiImageBin

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

        protected double m_dSum1
        DOCUMENT ME!
      • m_dSum2

        protected double m_dSum2
        DOCUMENT ME!
      • m_iNumBins

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

        protected int m_iSum0
        Cummulative summations for computing the total variance.
    • Constructor Detail

      • RegistrationMeasureCorrelationRatio

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

        public RegistrationMeasureCorrelationRatio​(int iNumBins)
        Constructor.
        Parameters:
        iNumBins - int Number of bins to use for computation.
    • Method Detail

      • getStaticName

        public static java.lang.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 java.lang.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.
      • getVariance

        protected static final double getVariance​(int N,
                                                  double dSum1,
                                                  double dSum2)
        Compute the variance given the total number of samples along with the sum of values and sum of squared values.
        Parameters:
        N - int Number of samples.
        dSum1 - double Sum of sample values.
        dSum2 - double Sum of sample squared values.
        Returns:
        double Computed variance. Zero is returned if there are not at least two samples.