Package gov.nih.mipav.model.algorithms
Class AlgorithmCenterOfMassRGB
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmCenterOfMassRGB
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmCenterOfMassRGB extends AlgorithmBase
* This algorithm calculates the red, green, and blue center of mass for 2D and 3D color images.- Version:
- 1.0 February 26, 2008
- Author:
- William Gandler
-
-
Field Summary
Fields Modifier and Type Field Description private booleanentireImageFlag, if true, indicates that the whole image should be processed.private float[]thresholdBDOCUMENT ME!private float[]thresholdGDOCUMENT ME!private float[]thresholdRThree arrays (R,G,B) containing minimum and maximum threshold for each channel.-
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 AlgorithmCenterOfMassRGB(ModelImage srcImage, float[] thresholdR, float[] thresholdG, float[] thresholdB, boolean maskFlag)Default constructor for running algorithm to calculate red, green, and blue centers of mass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcalcInPlace2D()Calculate red, green, and blue centers of mass for 2D color image.private voidcalcInPlace3D()Calculates red, green, and blue centers of mass in 3D color image.voidfinalize()Prepares this class for destruction.float[]getThresholdB()float[]getThresholdG()float[]getThresholdR()voidrunAlgorithm()Starts the program.-
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
-
entireImage
private boolean entireImage
Flag, if true, indicates that the whole image should be processed. If false on process the image over the mask areas.
-
thresholdB
private float[] thresholdB
DOCUMENT ME!
-
thresholdG
private float[] thresholdG
DOCUMENT ME!
-
thresholdR
private float[] thresholdR
Three arrays (R,G,B) containing minimum and maximum threshold for each channel.
-
-
Constructor Detail
-
AlgorithmCenterOfMassRGB
public AlgorithmCenterOfMassRGB(ModelImage srcImage, float[] thresholdR, float[] thresholdG, float[] thresholdB, boolean maskFlag)
Default constructor for running algorithm to calculate red, green, and blue centers of mass.- Parameters:
srcImage- ModelImage sourcethresholdR- float[] red threshthresholdG- float[] green threshthresholdB- float[] blue threshmaskFlag- boolean whole image or voi
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithmin classAlgorithmBase
-
calcInPlace2D
private void calcInPlace2D()
Calculate red, green, and blue centers of mass for 2D color image.
-
calcInPlace3D
private void calcInPlace3D()
Calculates red, green, and blue centers of mass in 3D color image.
-
getThresholdR
public float[] getThresholdR()
-
getThresholdG
public float[] getThresholdG()
-
getThresholdB
public float[] getThresholdB()
-
-