Class AlgorithmMask
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.utilities.AlgorithmMask
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmMask extends AlgorithmBase
Allow the user to fill a VOI or fill everything outside the VOI with a specific fill value.- Version:
- 0.1 Feb 11, 1998
- Author:
- Matthew J. McAuliffe, Ph.D.
-
-
Field Summary
Fields Modifier and Type Field Description private float
imageFill
Set the mask areas to this value.private float
imageFillB
DOCUMENT ME!private float
imageFillG
DOCUMENT ME!private float
imageFillI
private float
imageFillR
DOCUMENT ME!private boolean
polarity
if true then fill inside the VOI.-
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 AlgorithmMask(ModelImage srcImg, float fill, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.AlgorithmMask(ModelImage srcImg, float fill, float fillI, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.AlgorithmMask(ModelImage srcImg, float fillR, float fillG, float fillB, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.AlgorithmMask(ModelImage destImg, ModelImage srcImg, float fill, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.AlgorithmMask(ModelImage destImg, ModelImage srcImg, float fill, float fillI, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.AlgorithmMask(ModelImage destImg, ModelImage srcImg, float fillR, float fillG, float fillB, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.AlgorithmMask(ModelImage srcImg, java.awt.Color _fillColor, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calcInPlace25D(java.util.BitSet mask, float fillValue, int tSlice)
Fills VOI of the source image with fill value.void
calcInPlace25D(java.util.BitSet mask, float fillValue, int tSlice, java.util.Vector<java.lang.Integer> intensityLockVector, boolean showProgressBar)
Fills VOI of the source image with fill value.void
calcInPlace25DC(java.util.BitSet mask, java.awt.Color fillColor, int tSlice, java.lang.String rgbString, java.util.Vector<java.lang.Integer> intensityLockVector, boolean showProgressBar)
Fills VOI of the color source image with fill color.void
calcInPlace25DCMask(java.util.BitSet mask, java.awt.Color fillColor, int tSlice)
Fills VOI of the color source image with fill color.void
calcInPlace25DMask(java.util.BitSet mask, float fillValue, int tSlice)
Fills VOI of the source image with fill value.void
calcInPlace25DMask(java.util.BitSet mask, float fillValue, int tSlice, java.util.Vector<java.lang.Integer> intensityLockVector)
Fills VOI of the source image with fill value.private void
calcInPlace2D()
Fills VOI of source image with fill value.private void
calcInPlace2DComplex()
Fills VOI of source image with fill value.private void
calcInPlace2DRGB()
Fills VOI of source image with fill value.private void
calcInPlace3D()
Fills VOI of the source image with fill value.private void
calcInPlace3DComplex()
Fills VOI of the source image with fill value.private void
calcInPlace3DRGB()
Fills VOI of the source image with fill value.private void
calcInPlace4D()
Fills VOI of the source image with fill value.private void
calcInPlace4DComplex()
Fills VOI of the source image with fill value.private void
calcInPlace4DRGB()
Fills VOI of the source image with fill value.private void
calcStoreInDest2D()
Fills new image/VOI with new fill value;private void
calcStoreInDest2DComplex()
Fills new image/VOI with new fill value;private void
calcStoreInDest2DRGB()
Fills new image/VOI with new fill value;private void
calcStoreInDest3D()
Fills new image/VOI with new fill value;private void
calcStoreInDest3DComplex()
Fills new image/VOI with new fill value;private void
calcStoreInDest3DRGB()
Fills new image/VOI with new fill value;private void
calcStoreInDest4D()
Fills new image/VOI with new fill value;private void
calcStoreInDest4DComplex()
Fills new image/VOI with new fill value;private void
calcStoreInDest4DRGB()
Fills new image/VOI with new fill value;void
finalize()
Prepares this class for destruction.void
runAlgorithm()
Starts the program.-
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, 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
-
imageFill
private float imageFill
Set the mask areas to this value.
-
imageFillB
private float imageFillB
DOCUMENT ME!
-
imageFillG
private float imageFillG
DOCUMENT ME!
-
imageFillR
private float imageFillR
DOCUMENT ME!
-
imageFillI
private float imageFillI
-
polarity
private boolean polarity
if true then fill inside the VOI. If false then fill outside
-
-
Constructor Detail
-
AlgorithmMask
public AlgorithmMask(ModelImage srcImg, float fill, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.- Parameters:
srcImg
- source image modelfill
- value used to fill a regionpolarity
- flag indicating fill location, true = fill inside; false fill outsideuseVOI
- use the VOI to define the mask area else it will use the painted area to define the mask.
-
AlgorithmMask
public AlgorithmMask(ModelImage srcImg, java.awt.Color _fillColor, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.- Parameters:
srcImg
- source image model_fillColor
- color used to fill a regionpolarity
- flag indicating fill location, true = fill inside; false fill outsideuseVOI
- use the VOI to define the mask area else it will use the painted area to define the mask.
-
AlgorithmMask
public AlgorithmMask(ModelImage destImg, ModelImage srcImg, float fill, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.- Parameters:
destImg
- image model where result image is to storedsrcImg
- source image modelfill
- value used to fill a regionpolarity
- flag indicating fill location, true = fill inside; false fill outsideuseVOI
- use the VOI to define the mask area else it will use the painted area to define the mask.
-
AlgorithmMask
public AlgorithmMask(ModelImage srcImg, float fillR, float fillG, float fillB, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.- Parameters:
srcImg
- source image modelfillR
- red value used to fill a regionfillG
- green value used to fill a regionfillB
- blue value used to fill a regionpolarity
- flag indicating fill location, true = fill inside; false fill outsideuseVOI
- use the VOI to define the mask area else it will use the painted area to define the mask.
-
AlgorithmMask
public AlgorithmMask(ModelImage destImg, ModelImage srcImg, float fillR, float fillG, float fillB, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.- Parameters:
destImg
- image model where result image is to storedsrcImg
- source image modelfillR
- red value used to fill a regionfillG
- green value used to fill a regionfillB
- blue value used to fill a regionpolarity
- flag indicating fill location, true = fill inside; false fill outsideuseVOI
- use the VOI to define the mask area else it will use the painted area to define the mask.
-
AlgorithmMask
public AlgorithmMask(ModelImage srcImg, float fill, float fillI, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.- Parameters:
srcImg
- source image modelfill
- real value used to fill a regionfillI
- imaginary value used to fill a regionpolarity
- flag indicating fill location, true = fill inside; false fill outsideuseVOI
- use the VOI to define the mask area else it will use the painted area to define the mask.
-
AlgorithmMask
public AlgorithmMask(ModelImage destImg, ModelImage srcImg, float fill, float fillI, boolean polarity, boolean useVOI)
Creates a new AlgorithmMask object.- Parameters:
destImg
- image model where result image is to storedsrcImg
- source image modelfill
- real value used to fill a regionfillI
- imaginary value used to fill a regionpolarity
- flag indicating fill location, true = fill inside; false fill outsideuseVOI
- use the VOI to define the mask area else it will use the painted area to define the mask.
-
-
Method Detail
-
calcInPlace25D
public void calcInPlace25D(java.util.BitSet mask, float fillValue, int tSlice)
Fills VOI of the source image with fill value.- Parameters:
mask
- DOCUMENT ME!fillValue
- value to be placed in the image where the mask is truetSlice
- indicates which volume should be painted (tSlice = 4th dimension)
-
calcInPlace25D
public void calcInPlace25D(java.util.BitSet mask, float fillValue, int tSlice, java.util.Vector<java.lang.Integer> intensityLockVector, boolean showProgressBar)
Fills VOI of the source image with fill value.- Parameters:
mask
- DOCUMENT ME!fillValue
- value to be placed in the image where the mask is truetSlice
- indicates which volume should be painted (tSlice = 4th dimension)intensityLockVector
- Vector containing Integer objects that represent the intensity values that are not mutable
-
calcInPlace25DC
public void calcInPlace25DC(java.util.BitSet mask, java.awt.Color fillColor, int tSlice, java.lang.String rgbString, java.util.Vector<java.lang.Integer> intensityLockVector, boolean showProgressBar)
Fills VOI of the color source image with fill color.- Parameters:
mask
- DOCUMENT ME!fillColor
- color to be placed in the image where the mask is truetSlice
- indicates which volume should be painted (tSlice = 4th dimension)
-
calcInPlace25DCMask
public void calcInPlace25DCMask(java.util.BitSet mask, java.awt.Color fillColor, int tSlice)
Fills VOI of the color source image with fill color.- Parameters:
mask
- DOCUMENT ME!fillColor
- color to be placed in the image where the mask is truetSlice
- indicates which volume should be painted (tSlice = 4th dimension)
-
calcInPlace25DMask
public void calcInPlace25DMask(java.util.BitSet mask, float fillValue, int tSlice)
Fills VOI of the source image with fill value.- Parameters:
mask
- DOCUMENT ME!fillValue
- value to be placed in the image where the mask is truetSlice
- indicates which volume should be painted (tSlice = 4th dimension)
-
calcInPlace25DMask
public void calcInPlace25DMask(java.util.BitSet mask, float fillValue, int tSlice, java.util.Vector<java.lang.Integer> intensityLockVector)
Fills VOI of the source image with fill value.- Parameters:
mask
- DOCUMENT ME!fillValue
- value to be placed in the image where the mask is truetSlice
- indicates which volume should be painted (tSlice = 4th dimension)intensityLockVector
- DOCUMENT ME!
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
calcInPlace2D
private void calcInPlace2D()
Fills VOI of source image with fill value.
-
calcInPlace2DComplex
private void calcInPlace2DComplex()
Fills VOI of source image with fill value.
-
calcInPlace2DRGB
private void calcInPlace2DRGB()
Fills VOI of source image with fill value.
-
calcInPlace3D
private void calcInPlace3D()
Fills VOI of the source image with fill value.
-
calcInPlace3DComplex
private void calcInPlace3DComplex()
Fills VOI of the source image with fill value.
-
calcInPlace3DRGB
private void calcInPlace3DRGB()
Fills VOI of the source image with fill value.
-
calcInPlace4D
private void calcInPlace4D()
Fills VOI of the source image with fill value.
-
calcInPlace4DComplex
private void calcInPlace4DComplex()
Fills VOI of the source image with fill value.
-
calcInPlace4DRGB
private void calcInPlace4DRGB()
Fills VOI of the source image with fill value.
-
calcStoreInDest2D
private void calcStoreInDest2D()
Fills new image/VOI with new fill value;
-
calcStoreInDest2DComplex
private void calcStoreInDest2DComplex()
Fills new image/VOI with new fill value;
-
calcStoreInDest2DRGB
private void calcStoreInDest2DRGB()
Fills new image/VOI with new fill value;
-
calcStoreInDest3D
private void calcStoreInDest3D()
Fills new image/VOI with new fill value;
-
calcStoreInDest3DComplex
private void calcStoreInDest3DComplex()
Fills new image/VOI with new fill value;
-
calcStoreInDest3DRGB
private void calcStoreInDest3DRGB()
Fills new image/VOI with new fill value;
-
calcStoreInDest4D
private void calcStoreInDest4D()
Fills new image/VOI with new fill value;
-
calcStoreInDest4DComplex
private void calcStoreInDest4DComplex()
Fills new image/VOI with new fill value;
-
calcStoreInDest4DRGB
private void calcStoreInDest4DRGB()
Fills new image/VOI with new fill value;
-
-