Package gov.nih.mipav.model.algorithms
Class AlgorithmFloodFill
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmFloodFill
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
Stack based flood-fill for 2D and 3D images. The input is a binary (BitSet) object and produces a BitSet or short
mask. A short mask allows for different label values for disconnected objects in a BitSet image. For example, in a
binarized image of cells, each cell could be labeled(filled) with a separate value. However, a short mask uses 16X
more memory than does the BitSet mask.
- Version:
- 0.1 Jan 5, 1998
- Author:
- Matthew J. McAuliffe, Ph.D.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortDOCUMENT ME!private int[]Dimensionality of the data.private shortFlood value.private BitSetDOCUMENT ME!private intIndicates the type of result mask: BITSET or SHORT.private intThe number of dimensions.private BitSetDOCUMENT ME!private short[]Reference to short mask.private PointSeed point for 2D datasets.private Point3DSeed point for 3D datasets.static final shortDOCUMENT ME!Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, 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
ConstructorsConstructorDescriptionAlgorithmFloodFill(BitSet mask, int[] dims, int mode, Point3D pt) Stack based flood-fill for 2D and 3D images.AlgorithmFloodFill(BitSet mask, int[] dims, int mode, Point pt) Stack based flood-fill for 2D and 3D images. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for destruction.2D flood fill that forms a binary(BitSet) mask.short[]2D flood fill that forms a short mask.3D flood fill that forms a binary(BitSet) mask.short[]3D flood fill that forms a short mask.Gets the Mask image returned as a Java Bitset object.short[]Gets the mask image (array of short values).voidStarts the program.voidsetBitSetMask(BitSet mask) Sets this classes BitSet mask to new mask.voidsetFloodValue(short floodValue) Sets the value to be placed in the flood region.voidsetSeed2DPt(Point seedPt) Sets the seed point for the flood fill for a 2D image region grow.voidsetSeed3DPt(Point3D seedPt) Sets the point at which a the flood filling begins.voidsetShortMask(short[] mask) Sets this classes short mask to the new mask.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
-
BITSET
public static final short BITSETDOCUMENT ME!- See Also:
-
SHORT
public static final short SHORTDOCUMENT ME!- See Also:
-
dims
private int[] dimsDimensionality of the data. -
floodValue
private short floodValueFlood value. Default in 1. -
mask
DOCUMENT ME! -
mode
private int modeIndicates the type of result mask: BITSET or SHORT. -
nDims
private int nDimsThe number of dimensions. -
newMask
DOCUMENT ME! -
newShortMask
private short[] newShortMaskReference to short mask. -
seed2DPt
Seed point for 2D datasets. -
seed3DPt
Seed point for 3D datasets.
-
-
Constructor Details
-
AlgorithmFloodFill
Stack based flood-fill for 2D and 3D images.- Parameters:
mask- BitSet object that has the binary object(s) that needs to be filleddims- dimensionality of maskmode- BITSET or SHORT mode for result maskpt- seed point for the flood fill to begin for 2D image
-
AlgorithmFloodFill
Stack based flood-fill for 2D and 3D images.- Parameters:
mask- BitSet object that has the binary object(s) that needs to be filleddims- dimensionality of maskmode- BITSET or SHORT mode for result maskpt- seed point for the flood fill to begin for 3D image
-
-
Method Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
floodFill2DBitSet
2D flood fill that forms a binary(BitSet) mask.- Returns:
- mask of flooded image
-
floodFill2DShort
public short[] floodFill2DShort()2D flood fill that forms a short mask.- Returns:
- mask of flooded image
-
floodFill3DBitSet
3D flood fill that forms a binary(BitSet) mask.- Returns:
- mask of flooded image
-
floodFill3DShort
public short[] floodFill3DShort()3D flood fill that forms a short mask.- Returns:
- mask of flooded image
-
getBitSetMask
Gets the Mask image returned as a Java Bitset object.- Returns:
- BitSet mask of flooded image
-
getShortMask
public short[] getShortMask()Gets the mask image (array of short values).- Returns:
- short mask of flooded image
-
runAlgorithm
public void runAlgorithm()Starts the program.- Specified by:
runAlgorithmin classAlgorithmBase
-
setBitSetMask
Sets this classes BitSet mask to new mask.- Parameters:
mask- sets BitSet mask
-
setFloodValue
public void setFloodValue(short floodValue) Sets the value to be placed in the flood region.- Parameters:
floodValue- sets the flood-fill value used when generating a short type mask
-
setSeed2DPt
Sets the seed point for the flood fill for a 2D image region grow.- Parameters:
seedPt- sets 2D seed point for beginning of flood fill
-
setSeed3DPt
Sets the point at which a the flood filling begins.- Parameters:
seedPt- sets 3D seed point for beginning of flood fill
-
setShortMask
public void setShortMask(short[] mask) Sets this classes short mask to the new mask.- Parameters:
mask- sets short mask
-