Package gov.nih.mipav.model.algorithms
Class AlgorithmAutoCovariance
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmAutoCovariance
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmAutoCovariance extends AlgorithmBase
let deli(x,y) = (i(x,y) - )/ where the angle brackets are used to denote a spatial average. Then the two-dimensional autocovariance function, g(e,n) is defined as g(e,n) =which for a M by P discrete data set is calculated as g(e,n) = (num/denom) - 1 where num = (1/(M - e)(P - n))sum from j = 1 to M-e sum from k = 1 to P-n for: i(j,k)*i(j+e,k+n) denom = [(1/(2(M-e)(P-n))) sum from j = 1 to M sum from k = 1 to P of i(j,k) + i(j+e,k+n)]**2 Note that while some medical literature refers to this as a autocorrelation, it is actually an autocovariance since means are subtracted. 3 articles in which this formula are used: 1.) "Two-photon image correlation spectroscopy and image cross-correlation spectroscopy" by P. W. Wiseman, J.A. Squier, M.H. Ellisman, and K.R. Wilson, Journal of Microscopy, Vol. 200. Pt. 1, October 2000, pp. 14-25. 2.) "Quantitation of Membrane Receptor Distributions by Image Correlation Spectroscopy: Concept and Application" by Nils O. Petersen, Pia L. Hoddelius, Paul W. Wiseman, Olle Seger, and Karl-Eric Magnusson, Biophysical Journal, Volume 65, September, 1993, pp. 1135-1146. 3.) "Image cross-correlation spectroscopy: A new experimental bipohysical approach to measurement of slow diffusion of fluorescent molecules" by Mamta Srivastava & Nils O. Petersen, Methods in Cell Science, Vol 18, March, 1996, pp. 47-54. The autocovariance fits to a function of the form a0 + a1*exp(-(x**2 + y**2)/w**2) = a0 + a1*exp(a2*distSqr), where a2 < 0. The fitting is performed to determine the full width at half maximum of the autocovariance. For color images the full width at half maximum is considered to be the minimum of the red, green, and blue values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
AlgorithmAutoCovariance.FitCovarianceModel
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 autocovariance.private int
fwhmB
DOCUMENT ME!private int
fwhmG
DOCUMENT ME!private int
fwhmR
DOCUMENT ME!-
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 AlgorithmAutoCovariance(ModelImage destImg, ModelImage srcImg)
Constructor for black and white image in which covariance coefficients are placed in a predetermined destination image.AlgorithmAutoCovariance(ModelImage destImageR, ModelImage destImageG, ModelImage destImageB, ModelImage srcImg)
Constructor for color image in which covariance 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 autocovariance coefficients and places them in the destination image for black and white images.private void
calcStoreInDest2DC()
This function calculates the autocovariance coefficients and places them in the destination images for color images.private void
calcStoreInDest3D()
This function calculates the autocovariance coefficients and places them in the destination image for black and white images.private void
calcStoreInDest3DC()
This function calculates the autocovariance coefficients and places them in the destination images for color images.private void
calcStoreInDest4D()
This function calculates the autocovariance coefficients and places them in the destination image for black and white images.private void
calcStoreInDest4DC()
This function calculates the autocovariance coefficients and places them in the destination images for color images.void
finalize()
Prepares this class for destruction.int
getFWHM()
returns the full width at half maximum of the autocovariance.int
getFWHMB()
returns the full width at half maximum of the blue autocovariance.int
getFWHMG()
returns the full width at half maximum of the green autocovariance.int
getFWHMR()
returns the full width at half maximum of the red autocovariance.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 autocovariance.
-
fwhmB
private int fwhmB
DOCUMENT ME!
-
fwhmG
private int fwhmG
DOCUMENT ME!
-
fwhmR
private int fwhmR
DOCUMENT ME!
-
-
Constructor Detail
-
AlgorithmAutoCovariance
public AlgorithmAutoCovariance(ModelImage destImg, ModelImage srcImg)
Constructor for black and white image in which covariance coefficients are placed in a predetermined destination image.- Parameters:
destImg
- Image model where result image is stored.srcImg
- Source image model.
-
AlgorithmAutoCovariance
public AlgorithmAutoCovariance(ModelImage destImageR, ModelImage destImageG, ModelImage destImageB, ModelImage srcImg)
Constructor for color image in which covariance 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 autocovariance.- Returns:
- fwhm
-
getFWHMB
public int getFWHMB()
returns the full width at half maximum of the blue autocovariance.- Returns:
- fwhmB
-
getFWHMG
public int getFWHMG()
returns the full width at half maximum of the green autocovariance.- Returns:
- fwhmG
-
getFWHMR
public int getFWHMR()
returns the full width at half maximum of the red autocovariance.- Returns:
- fwhmR
-
runAlgorithm
public void runAlgorithm()
Starts the algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
calcStoreInDest2D
private void calcStoreInDest2D()
This function calculates the autocovariance coefficients and places them in the destination image for black and white images.
-
calcStoreInDest2DC
private void calcStoreInDest2DC()
This function calculates the autocovariance coefficients and places them in the destination images for color images.
-
calcStoreInDest3D
private void calcStoreInDest3D()
This function calculates the autocovariance coefficients and places them in the destination image for black and white images.
-
calcStoreInDest3DC
private void calcStoreInDest3DC()
This function calculates the autocovariance coefficients and places them in the destination images for color images.
-
calcStoreInDest4D
private void calcStoreInDest4D()
This function calculates the autocovariance coefficients and places them in the destination image for black and white images.
-
calcStoreInDest4DC
private void calcStoreInDest4DC()
This function calculates the autocovariance coefficients and places them in the destination images for color images.
-
-