Package gov.nih.mipav.model.algorithms
Class AlgorithmAutoCorrelation
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmAutoCorrelation
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmAutoCorrelation extends AlgorithmBase
Reference: Digital Image Processing, Second Edition by Rafael C. Gonzalez and Richard C. Woods, Prentice-Hall, Inc., 2002, pp. 205 - 208 and pp. 414-417. The autocorrelation coefficient = A(deltaX, deltaY)/A(0,0) where A(deltaX,deltaY) = num/denom with num = sum from X = 0 to X = xDim - 1 - deltaX sum from Y = 0 to Y = yDim - 1 - deltaY f(x,y)*f(x+deltaX,y+deltaY) denom = (xDim - deltaX)*(yDim - deltaY) Autocorrelation does not subtract out the means while autocovariance does subtract out the means.The autocorrelation coefficeints are fitted to a function of the form (1 - a0) + a0*exp(-(x**2 + y**2)/w**2) = (1 - a0) + a0*exp(a1*distSqr), where 1 >= a0 > 0, a1 < 0.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
AlgorithmAutoCorrelation.FitCorrelationModel
DOCUMENT ME!
-
Field Summary
Fields Modifier and Type Field Description private ModelImage
destImageB
DOCUMENT ME!private ModelImage
destImageG
DOCUMENT ME!private ModelImage
destImageR
DOCUMENT ME!private int
fwhm
Full width at half maximum of the autocorrelation.-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmAutoCorrelation(ModelImage destImg, ModelImage srcImg)
Constructor for black and white image in which correlation coefficients are placed in a predetermined destination image.AlgorithmAutoCorrelation(ModelImage destImageR, ModelImage destImageG, ModelImage destImageB, ModelImage srcImg)
Constructor for color image in which correlation coefficients are placed in predetermined destination images.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calcStoreInDest2D()
This function calculates the autocorrelation coefficients and places them in the destination image for black and white images.private void
calcStoreInDest2DC()
This function calculates the autocorrelation coefficients and places them in the destination image for color images.private void
calcStoreInDest3D()
This function calculates the autocorrelation coefficients and places them in the destination image for black and white images.private void
calcStoreInDest3DC()
This function calculates the autocorrelation coefficients and places them in the destination image for color images.private void
calcStoreInDest4D()
This function calculates the autocorrelation coefficients and places them in the destination image for black and white images.private void
calcStoreInDest4DC()
This function calculates the autocorrelation coefficients and places them in the destination image for color images.void
finalize()
Prepares this class for destruction.int
getFWHM()
Returns the full width at half maximum of the autocorrelation.void
runAlgorithm()
Starts the algorithm.-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
destImageB
private ModelImage destImageB
DOCUMENT ME!
-
destImageG
private ModelImage destImageG
DOCUMENT ME!
-
destImageR
private ModelImage destImageR
DOCUMENT ME!
-
fwhm
private int fwhm
Full width at half maximum of the autocorrelation.
-
-
Constructor Detail
-
AlgorithmAutoCorrelation
public AlgorithmAutoCorrelation(ModelImage destImg, ModelImage srcImg)
Constructor for black and white image in which correlation coefficients are placed in a predetermined destination image.- Parameters:
destImg
- Image model where result image is stored.srcImg
- Source image model.
-
AlgorithmAutoCorrelation
public AlgorithmAutoCorrelation(ModelImage destImageR, ModelImage destImageG, ModelImage destImageB, ModelImage srcImg)
Constructor for color image in which correlation coefficients are placed in predetermined destination images.- Parameters:
destImageR
- Image model where red result is stored.destImageG
- Image model where green result is stored.destImageB
- Image model where blue result is stored.srcImg
- Source image model.
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
getFWHM
public int getFWHM()
Returns the full width at half maximum of the autocorrelation.- Returns:
- fwhm
-
runAlgorithm
public void runAlgorithm()
Starts the algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
calcStoreInDest2D
private void calcStoreInDest2D()
This function calculates the autocorrelation coefficients and places them in the destination image for black and white images.
-
calcStoreInDest2DC
private void calcStoreInDest2DC()
This function calculates the autocorrelation coefficients and places them in the destination image for color images.
-
calcStoreInDest3D
private void calcStoreInDest3D()
This function calculates the autocorrelation coefficients and places them in the destination image for black and white images.
-
calcStoreInDest3DC
private void calcStoreInDest3DC()
This function calculates the autocorrelation coefficients and places them in the destination image for color images.
-
calcStoreInDest4D
private void calcStoreInDest4D()
This function calculates the autocorrelation coefficients and places them in the destination image for black and white images.
-
calcStoreInDest4DC
private void calcStoreInDest4DC()
This function calculates the autocorrelation coefficients and places them in the destination image for color images.
-
-