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:
ActionListener,WindowListener,Runnable,EventListener
* 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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanFlag, if true, indicates that the whole image should be processed.private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]Three 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, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmCenterOfMassRGB(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
Modifier and TypeMethodDescriptionprivate voidCalculate red, green, and blue centers of mass for 2D color image.private voidCalculates red, green, and blue centers of mass in 3D color image.voidfinalize()Prepares this class for destruction.float[]float[]float[]voidStarts 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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
entireImage
private boolean entireImageFlag, if true, indicates that the whole image should be processed. If false on process the image over the mask areas. -
thresholdB
private float[] thresholdBDOCUMENT ME! -
thresholdG
private float[] thresholdGDOCUMENT ME! -
thresholdR
private float[] thresholdRThree arrays (R,G,B) containing minimum and maximum threshold for each channel.
-
-
Constructor Details
-
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 Details
-
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()
-