Class AlgorithmRegionGrow
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
If variableThresholds is true, upperDelta = initialValue of upperBound - value of seed point lowerDelta = Value of seed point - initialValue of lowerBound Each time a new pixel is added to the region recalculate the mean and standard deviation of the region mean = (sum of the pixel values)/(pixel number) standard deviation = ((Sum of the squared values - (sum of values)*(sum of values)/(pixel number))/(pixel number) Then recalculate upperBound and lowBound as: upperBound = initialValue + (1.0 - Math.min(0.8, stdDev/mean)) * upperDelta lowBound = initialValue - (1.0 - Math.min(0.8, stdDev/mean)) * lowerDelta upperBound cannot become higher than its initial value, but it can become lower than its initial value. lowBound cannot become lower than its initial value, but it can become higher than its initial value. That is, upperBound - lowBound cannot exceed its initial value, but it can become lower than its initial value. Adaptive thresholding is useful in preventing bleeding across smooth image gradients. Reference: Automatic Image-To-Map-Registration of Remote Sensing Data by Heiner Hild, Photogrammetric Week '01', D. Fritsch invalid input: '&' R. Spiller, Eds., Wichmann Verlag, Heidelberg, 2001.
- Version:
- 0.5 Jan, 2000
- 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 TypeFieldDescriptionprivate float[]DOCUMENT ME!private doubleDOCUMENT ME!private float[]DOCUMENT ME!private RegionGrowDialogDOCUMENT ME!private ViewJFrameImageprivate doubleDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!private BitSetDOCUMENT ME!private float[]DOCUMENT ME!private ModelImageDOCUMENT ME!private double[][]DOCUMENT ME!Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmRegionGrow(ModelImage srcImg, float _multiplier, float _floodValue) Creates a new AlgorithmRegionGrow object.AlgorithmRegionGrow(ModelImage destImg, ModelImage srcImg, float _multiplier, float _floodValue) Creates a new AlgorithmRegionGrow object. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for destruction.intregionGrow2D(BitSet paintMask, Point seedPt, float th, boolean useVOI, boolean dp, RegionGrowDialog growDialog, float lowBoundR, float upperBoundR, float lowBoundG, float upperBoundG, float lowBoundB, float upperBoundB, int sizeLimit, float maxDistance) 2D flood fill for color images that forms a bitset(boolean) mask.intregionGrow2D(BitSet paintMask, Point seedPt, float th, boolean useVOI, boolean dp, RegionGrowDialog growDialog, float lowBound, float upperBound, int sizeLimit, float maxDistance, boolean variableThresholds) 2D flood fill that forms a bitset(boolean) mask.intregionGrow3D(BitSet paintMask, Point3D seedPt, float th, boolean useVOI, boolean dp, RegionGrowDialog growDialog, float lowBoundR, float upperBoundR, float lowBoundG, float upperBoundG, float lowBoundB, float upperBoundB, int sizeLimit, float maxDistance, int timeSlice, CubeBounds regionBounds) 3D flood fill for color images that forms a bitset(boolean) mask.intregionGrow3D(BitSet paintMask, Point3D seedPt, float th, boolean useVOI, boolean dp, RegionGrowDialog growDialog, float lowBound, float upperBound, int sizeLimit, float maxDistance, boolean variableThresholds, int timeSlice, CubeBounds regionBounds) 3D flood fill that forms a bitset(boolean) mask.voidStarts the program.voidsetNewThreshold(float threshold, PaintGrowListener compImage, boolean dp) DOCUMENT ME!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
-
blueBuffer
private float[] blueBufferDOCUMENT ME! -
c
private double cDOCUMENT ME! -
greenBuffer
private float[] greenBufferDOCUMENT ME! -
growDialog
DOCUMENT ME! -
imageFrame
-
mMean
private double mMeanDOCUMENT ME! -
mRMean
private double mRMeanDOCUMENT ME! -
mGMean
private double mGMeanDOCUMENT ME! -
mBMean
private double mBMeanDOCUMENT ME! -
paintMask
DOCUMENT ME! -
redBuffer
private float[] redBufferDOCUMENT ME! -
srcImage
DOCUMENT ME! -
varInverse
private double[][] varInverseDOCUMENT ME!
-
-
Constructor Details
-
AlgorithmRegionGrow
Creates a new AlgorithmRegionGrow object.- Parameters:
srcImg- source image model_multiplier- aaaaa_floodValue- aaaaa
-
AlgorithmRegionGrow
public AlgorithmRegionGrow(ModelImage destImg, ModelImage srcImg, float _multiplier, float _floodValue) Creates a new AlgorithmRegionGrow object.- Parameters:
destImg- image model where result image is to storedsrcImg- source image model_multiplier- placeholder_floodValue- placeholder
-
-
Method Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
regionGrow2D
public int regionGrow2D(BitSet paintMask, Point seedPt, float th, boolean useVOI, boolean dp, RegionGrowDialog growDialog, float lowBound, float upperBound, int sizeLimit, float maxDistance, boolean variableThresholds) 2D flood fill that forms a bitset(boolean) mask.- Parameters:
paintMask- mask used to indicated where region has grownseedPt- seed point for flood fillth-useVOI- use selected VOI for initial variancedp-growDialog- the RegionGrowDialoglowBound- lower bound of values which are included in the regionupperBound- upper bound of values which are included in the regionsizeLimit- stop region grow when objects exceeds size limit in pixelsmaxDistance- max distance from the seed point (in pixels) that the region is allowed to grow.variableThresholds- If true vary thresholds as region grows- Returns:
- returns the area region
-
regionGrow2D
public int regionGrow2D(BitSet paintMask, Point seedPt, float th, boolean useVOI, boolean dp, RegionGrowDialog growDialog, float lowBoundR, float upperBoundR, float lowBoundG, float upperBoundG, float lowBoundB, float upperBoundB, int sizeLimit, float maxDistance) 2D flood fill for color images that forms a bitset(boolean) mask.- Parameters:
paintMask- mask used to indicated where region has grownseedPt- seed point for flood fillth-useVOI- use selected VOI for initial variancedp-growDialog- the RegionGrowDialoglowBoundR- lower bound of red values which are included in the regionupperBoundR- upper bound of red values which are included in the regionlowBoundG- lower bound of green values which are included in the regionupperBoundG- upper bound of green values which are included in the regionlowBoundB- lower bound of blue values which are included in the regionupperBoundB- upper bound of blue values which are included in the regionsizeLimit- stop region grow when objects exceeds size limit in pixelsmaxDistance- max distance from the seed point (in pixels) that the region is allowed to grow.- Returns:
- returns the area region
-
regionGrow3D
public int regionGrow3D(BitSet paintMask, Point3D seedPt, float th, boolean useVOI, boolean dp, RegionGrowDialog growDialog, float lowBound, float upperBound, int sizeLimit, float maxDistance, boolean variableThresholds, int timeSlice, CubeBounds regionBounds) 3D flood fill that forms a bitset(boolean) mask.- Parameters:
paintMask- mask used to indicated where region has grownseedPt- seed point for flood fillth-useVOI- use selected VOI for initial variancedp-growDialog- the RegionGrowDialoglowBound- lower bound of values which are included in the regionupperBound- upper bound of values which are included in the regionsizeLimit- stop region grow when objects exceeds size limit in pixelsmaxDistance- max distance from the seed point (in pixels) that the region is allowed to grow.variableThresholds- If true vary thresholds as region growstimeSlice- timeSlice that will be used in a 4D imageregionBounds- DOCUMENT ME!- Returns:
- returns the volume region
-
regionGrow3D
public int regionGrow3D(BitSet paintMask, Point3D seedPt, float th, boolean useVOI, boolean dp, RegionGrowDialog growDialog, float lowBoundR, float upperBoundR, float lowBoundG, float upperBoundG, float lowBoundB, float upperBoundB, int sizeLimit, float maxDistance, int timeSlice, CubeBounds regionBounds) 3D flood fill for color images that forms a bitset(boolean) mask.- Parameters:
paintMask- mask used to indicated where region has grownseedPt- seed point for flood fillth-useVOI- use selected VOI for initial variancedp-growDialog- the RegionGrowDialoglowBoundR- lower bound of red values which are included in the regionupperBoundR- upper bound of red values which are included in the regionlowBoundG- lower bound of green values which are included in the regionupperBoundG- upper bound of green values which are included in the regionlowBoundB- lower bound of blue values which are included in the regionupperBoundB- upper bound of blue values which are included in the regionsizeLimit- stop region grow when objects exceeds size limit in pixelsmaxDistance- max distance from the seed point (in pixels) that the region is allowed to grow.timeSlice- timeSlice that will be used in a 4D imageregionBounds- DOCUMENT ME!- Returns:
- returns the volume region
-
runAlgorithm
public void runAlgorithm()Starts the program.- Specified by:
runAlgorithmin classAlgorithmBase
-
setNewThreshold
DOCUMENT ME!- Parameters:
threshold- DOCUMENT ME!compImage- DOCUMENT ME!dp-
-