Package gov.nih.mipav.model.algorithms
Class AlgorithmWatershed
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmWatershed
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
This program applies the watershed algorithm to the image. It assumes that the user has identified the starting
watershed regions via VOIs. Future work might be to develop a algorithm that automatically identifies initial seed
points and regions or possibly an automatic method that forms watersheds - see method at end of file (does not work
yet);
- Version:
- 1.1 March 11, 1998
- Author:
- Matthew J. McAuliffe, Ph.D. and Ray Lert, MD
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classSimple class to hold seed point and basin (object label) value.Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final shortDOCUMENT ME!private ModelImageDOCUMENT ME!private booleanIf true, ignore VOIs and process entire imageprivate static final shortDOCUMENT ME!private static final shortDOCUMENT ME!private Vector<AlgorithmWatershed.Seed> DOCUMENT ME!private float[]DOCUMENT ME!private static final shortDOCUMENT 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, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmWatershed(ModelImage destImg, ModelImage srcImg, ModelImage gmImg, float[] sigmas, Vector<AlgorithmWatershed.Seed> seeds) Constructs new watershed algorithm.AlgorithmWatershed(ModelImage destImg, ModelImage srcImg, ModelImage gmImg, float[] sigmas, Vector<AlgorithmWatershed.Seed> seeds, boolean entireImage) Constructs new watershed algorithm. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcalc2D()Calculates the watershed intialized by the VOI regions.private voidcalc3D()Calculates the watershed intialized by the VOI regions.voidfinalize()Prepares this class for destruction.voidStarts the program.voidsetEnergyImage(ModelImage _energyImage) This image is typically the gradient magnitude.voidsetSeedVector(WildMagic.LibFoundation.Mathematics.Vector3f[] seedPoints) Sets the seed vector.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
-
BOUNDARY
private static final short BOUNDARYDOCUMENT ME!- See Also:
-
MASK
private static final short MASKDOCUMENT ME!- See Also:
-
INITIAL
private static final short INITIALDOCUMENT ME!- See Also:
-
WSHED
private static final short WSHEDDOCUMENT ME!- See Also:
-
energyImage
DOCUMENT ME! -
seedVector
DOCUMENT ME! -
sigmas
private float[] sigmasDOCUMENT ME! -
entireImage
private boolean entireImageIf true, ignore VOIs and process entire image
-
-
Constructor Details
-
AlgorithmWatershed
public AlgorithmWatershed(ModelImage destImg, ModelImage srcImg, ModelImage gmImg, float[] sigmas, Vector<AlgorithmWatershed.Seed> seeds) Constructs new watershed algorithm.- Parameters:
destImg- Image model where result image is to storedsrcImg- Source image modelgmImg- Gradient magnitude image (can be null)sigmas- Gaussian's standard deviations in the each dimensionseeds- Seed points for starting watershed
-
AlgorithmWatershed
public AlgorithmWatershed(ModelImage destImg, ModelImage srcImg, ModelImage gmImg, float[] sigmas, Vector<AlgorithmWatershed.Seed> seeds, boolean entireImage) Constructs new watershed algorithm.- Parameters:
destImg- Image model where result image is to storedsrcImg- Source image modelgmImg- Gradient magnitude image (can be null)sigmas- Gaussian's standard deviations in the each dimensionseeds- Seed points for starting watershedentireImage- If true, ignore VOIs and process entire image
-
-
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
-
setEnergyImage
This image is typically the gradient magnitude. Peaks in this image (function ) are the watersheds boundaries- Parameters:
_energyImage- the energy image (function)
-
setSeedVector
public void setSeedVector(WildMagic.LibFoundation.Mathematics.Vector3f[] seedPoints) Sets the seed vector.- Parameters:
seedPoints- The seed points.
-
calc2D
private void calc2D()Calculates the watershed intialized by the VOI regions. The resultant watershed regions(basin) are labelled with an integer value. In addition, each region is separated by connected (8-way) watershed identifier of 1. -
calc3D
private void calc3D()Calculates the watershed intialized by the VOI regions. The resultant watershed regions(basin) are labelled with an integer value. In addition, each region is separated by connected (8-way) watershed identifier of 1.
-