Package gov.nih.mipav.model.algorithms
Class AlgorithmEfficientWatershed
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmEfficientWatershed
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmEfficientWatershed extends AlgorithmBase
- Author:
- ilb Reference: * 1.) The Watershed Transform: Definitions, Algorithms, and Parallelization Strategies by Jos B.T.M. Roerdink and Arnold Meijster, Fundamentals Informaticae 41 (2001), pp. 187-228. Algorithm 4.1 Vincent-Soille watershed algorithm 2.) Image Processing, Analysis, and Machine Vision 4th edition International Edition by Milan Sonka, Vaclav Hlavac, and Roger Boyle, Section 6.3.4 Watershed segmentation, pp. 229-232. 3.) Watersheds in Digital Spaces: An Efficient Algorithm Based on Immersion Simulations by Luc Vincent and Pierre Soille, IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 13, No. 6, June, 1991, pp. 583-598. 4.) Fast watershed algorithms: analysis and extensions by Bogdan P. Dobrin, Timo Viero, and Moncef Gabbouj. 5.) Watershed-Based Segmentation of 3D MR Data for Volume Quantization by J. Sijbers, P. Scheunders, M. Verhoye, A. Van Der Linden, D. van Dyck, and E. Raman, Magnetic Resonance Imaging, Vol. 15, No. 6, 1997, pp. 679-688. 6.) Automated Sulcal Segmentation Using Watersheds on the Cortical Surface by Maryam E. Rettmann, Xiao Han, Chenyang Xu, and Jerry L. Prince, NeuroImage 15, 2002, Section Merging of Catchment Basins, p.338. The ImageJ version has 3 differences with the original article pseudocode as noted in comments. Reference 2 states "Further improvements of the watershed segmentation based on immersion simulations are given in [Dobrin et al., 1994]." Reference 4 states: "Vincent & Soille algorithm produces a tesselation of the image into its disjoint catchment basins. Pixels lying exactly half-way between the two catchment basins, should be assigned to watersheds. Studying the operation of Vincent and Soille algorithms, we will show that this is not always the case. The algorithm has a tendency to generate large watershed regions, because it does not propagate only catchment basin labels but also watershed labels.... Therefore, the algorithm produces an ambiguous result when propagating watershed lines to a region. Another drawback of this algorithm is given by the oscillation in the pixel assignment rule. It is relatively easy to see ... that the value of the current pixel, i.e. the pixel whose value is to be determined, can change multiple times depending on its local neighborhood. For example, the current pixel can firstly be assigned to watersheds and then immediately to a catchment basin label or vice versa. As a result, the operation of the algorithm is inconsistent in several critical pixel configurations." Reference 5 uses a 3D version of this algorithm with 26 connectivity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
AlgorithmEfficientWatershed.indexValueComparator
private class
AlgorithmEfficientWatershed.indexValueItem
-
Field Summary
Fields Modifier and Type Field Description private int
binNumber
private static int
INIT
private boolean
limitBins
private static int
MASK
private boolean
merge
private double
mergeThreshold
private int
numNeighbor
private static int
WSHED
-
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 AlgorithmEfficientWatershed(ModelImage destImage, ModelImage srcImage, int numNeighbor, boolean limitBins, int binNumber, boolean merge, double mergeThreshold)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run2D()
void
run3D()
void
runAlgorithm()
Actually runs the algorithm.-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, 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
-
MASK
private static final int MASK
- See Also:
- Constant Field Values
-
WSHED
private static final int WSHED
- See Also:
- Constant Field Values
-
INIT
private static final int INIT
- See Also:
- Constant Field Values
-
numNeighbor
private int numNeighbor
-
limitBins
private boolean limitBins
-
binNumber
private int binNumber
-
merge
private boolean merge
-
mergeThreshold
private double mergeThreshold
-
-
Constructor Detail
-
AlgorithmEfficientWatershed
public AlgorithmEfficientWatershed(ModelImage destImage, ModelImage srcImage, int numNeighbor, boolean limitBins, int binNumber, boolean merge, double mergeThreshold)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
run2D
public void run2D()
-
run3D
public void run3D()
-
-