Class RegistrationMeasureCorrelationRatio
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.registration.RegistrationMeasure
-
- gov.nih.mipav.model.algorithms.registration.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_adBinSum1Sum of the intensities in bin.protected double[]m_adBinSum2Sum of the squared intensities in bin.protected int[]m_aiBinSum0Bins used to hold cummulative summations for computing the variances.protected int[]m_aiImageBinImage corresponding to the samples in the target image which identifies to which bin the sample belongs.protected doublem_dSum1DOCUMENT ME!protected doublem_dSum2DOCUMENT ME!protected intm_iNumBinsNumber of bins to use for computation.protected intm_iSum0Cummulative summations for computing the total variance.-
Fields inherited from class gov.nih.mipav.model.algorithms.registration.RegistrationMeasure
m_iNumSamples, m_kImageReg, m_kImageTrg
-
-
Constructor Summary
Constructors Constructor Description RegistrationMeasureCorrelationRatio()Constructor which sets up for a default number of bins.RegistrationMeasureCorrelationRatio(int iNumBins)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RegistrationMeasurecreateNew()Create a new instance of this measure.doublegetError()Return the current error measure between the target image and the registered source image.java.lang.StringgetName()Return the name of the particular registration measure.static java.lang.StringgetStaticName()Return the name of the particular registration measure without having an instance.protected static doublegetVariance(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.voidsetImages(ModelSimpleImage kImageSrc, ModelSimpleImage kImageTrg)Setup the measure to use information from the target image and the original source image.voidupdateRegistration(int iIndex, float fNewValue)Update the specified value in the registered source image.-
Methods inherited from class gov.nih.mipav.model.algorithms.registration.RegistrationMeasure
createEmptyImage, getImageRegistered
-
-
-
-
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:
createNewin classRegistrationMeasure- 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:
getErrorin classRegistrationMeasure- 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:
getNamein classRegistrationMeasure- 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:
setImagesin classRegistrationMeasure- 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:
updateRegistrationin classRegistrationMeasure- 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.
-
-