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:
ActionListener,WindowListener,Runnable,EventListener
- 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 invalid input: '&' 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 ClassesModifier and TypeClassDescriptionprivate classprivate classNested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final intprivate booleanprivate static final intprivate booleanprivate doubleprivate intprivate static final intFields 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
ConstructorsConstructorDescriptionAlgorithmEfficientWatershed(ModelImage destImage, ModelImage srcImage, int numNeighbor, boolean limitBins, int binNumber, boolean merge, double mergeThreshold) -
Method Summary
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, 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
-
MASK
private static final int MASK- See Also:
-
WSHED
private static final int WSHED- See Also:
-
INIT
private static final int INIT- See Also:
-
numNeighbor
private int numNeighbor -
limitBins
private boolean limitBins -
binNumber
private int binNumber -
merge
private boolean merge -
mergeThreshold
private double mergeThreshold
-
-
Constructor Details
-
AlgorithmEfficientWatershed
public AlgorithmEfficientWatershed(ModelImage destImage, ModelImage srcImage, int numNeighbor, boolean limitBins, int binNumber, boolean merge, double mergeThreshold)
-
-
Method Details
-
runAlgorithm
public void runAlgorithm()Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-
run2D
public void run2D() -
run3D
public void run3D()
-