Package gov.nih.mipav.model.algorithms
Class AlgorithmVOIExtractionPaint
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmVOIExtractionPaint
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmVOIExtractionPaint extends AlgorithmBase
DOCUMENT ME!
-
-
Field Summary
Fields Modifier and Type Field Description private VOI
addedVOI
DOCUMENT ME!private int
expandedLength
(xDim2+2)*(yDim2+2)private int
length
xDim2*yDim2.private java.util.BitSet
mask
DOCUMENT ME!private java.util.BitSet
mask2
DOCUMENT ME!private java.util.BitSet
maskAll
DOCUMENT ME!private java.util.BitSet
maskE
DOCUMENT ME!private java.util.BitSet
maskExpanded
private int[][]
maskList
DOCUMENT ME!private java.util.BitSet
maskN
DOCUMENT ME!private java.util.BitSet
maskS
DOCUMENT ME!private java.util.BitSet
maskW
DOCUMENT ME!private int
neighbors
DOCUMENT ME!private int[][]
nextMaskList
DOCUMENT ME!private java.util.BitSet
outMask
DOCUMENT ME!private int
smallLength
xDim * yDim.private int
smallPos
DOCUMENT ME!private int
smallPos3D
DOCUMENT ME!private int
smallX
DOCUMENT ME!private int
smallY
DOCUMENT ME!private ModelImage
srcImage
DOCUMENT ME!private java.util.BitSet
srcPaintMask
DOCUMENT ME!private int
testPos
x + y*xDim.private short
voiIDnum
DOCUMENT ME!private int
x
current x position.private int
xDim
DOCUMENT ME!private int
xDim2
DOCUMENT ME!private int
xDim4
DOCUMENT ME!private int
xt
DOCUMENT ME!private int
y
current y position.private int
yDim
DOCUMENT ME!private int
yDim2
DOCUMENT ME!private int
yt
DOCUMENT ME!private int
z
current z slice.private int
zDim
extent of z dimension in the in the source image.-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmVOIExtractionPaint(ModelImage sourceImage)
Constructor for finding the borders of the paint on various slices of an image.AlgorithmVOIExtractionPaint(ModelImage sourceImage, java.util.BitSet srcPaint, int xDimen, int yDimen, int zDimen, short voiID)
Construct the extractor for paint extraction to a VOI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calcInPlace()
Calculates the VOI extraction.void
finalize()
Prepares this class for destruction.java.util.Vector<java.awt.Polygon>
findPaintBorder(int slice)
Finds a set of lines which surround the paint in the image.void
runAlgorithm()
Starts the program.void
setPaintMask(java.util.BitSet mask)
Changes the paint mask that we look for borders in.private void
setRegionMaskAll()
Sets the mask of all points in the 4 connected region with a gray scale value.private void
setRegionMaskI(int xStart, int yStart, int offset)
Sets the mask of all points in the 4 connected region with a gray scale value of objectValue Uses iteration.private void
setRegionMaskIFalse(int xStart, int yStart, int offset)
Sets the mask of all points in the 4 connected region with a gray scale value of objectValue.private void
setRegionOutMaskI(int xStart, int yStart, int offset)
Sets the mask of all points in the 4 connected region with a srcPaintMask equal to false Uses iteration.-
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
-
addedVOI
private VOI addedVOI
DOCUMENT ME!
-
length
private int length
xDim2*yDim2.
-
expandedLength
private int expandedLength
(xDim2+2)*(yDim2+2)
-
mask
private java.util.BitSet mask
DOCUMENT ME!
-
mask2
private java.util.BitSet mask2
DOCUMENT ME!
-
maskAll
private java.util.BitSet maskAll
DOCUMENT ME!
-
maskE
private java.util.BitSet maskE
DOCUMENT ME!
-
maskList
private int[][] maskList
DOCUMENT ME!
-
maskN
private java.util.BitSet maskN
DOCUMENT ME!
-
maskS
private java.util.BitSet maskS
DOCUMENT ME!
-
maskW
private java.util.BitSet maskW
DOCUMENT ME!
-
neighbors
private int neighbors
DOCUMENT ME!
-
nextMaskList
private int[][] nextMaskList
DOCUMENT ME!
-
outMask
private java.util.BitSet outMask
DOCUMENT ME!
-
smallLength
private int smallLength
xDim * yDim.
-
smallPos
private int smallPos
DOCUMENT ME!
-
smallPos3D
private int smallPos3D
DOCUMENT ME!
-
smallX
private int smallX
DOCUMENT ME!
-
smallY
private int smallY
DOCUMENT ME!
-
srcImage
private ModelImage srcImage
DOCUMENT ME!
-
srcPaintMask
private java.util.BitSet srcPaintMask
DOCUMENT ME!
-
testPos
private int testPos
x + y*xDim.
-
voiIDnum
private short voiIDnum
DOCUMENT ME!
-
x
private int x
current x position.
-
xDim
private int xDim
DOCUMENT ME!
-
xDim2
private int xDim2
DOCUMENT ME!
-
xDim4
private int xDim4
DOCUMENT ME!
-
xt
private int xt
DOCUMENT ME!
-
yt
private int yt
DOCUMENT ME!
-
y
private int y
current y position.
-
yDim
private int yDim
DOCUMENT ME!
-
yDim2
private int yDim2
DOCUMENT ME!
-
z
private int z
current z slice.
-
zDim
private int zDim
extent of z dimension in the in the source image.
-
maskExpanded
private java.util.BitSet maskExpanded
-
-
Constructor Detail
-
AlgorithmVOIExtractionPaint
public AlgorithmVOIExtractionPaint(ModelImage sourceImage)
Constructor for finding the borders of the paint on various slices of an image.- Parameters:
sourceImage
- the image that has been painted
-
AlgorithmVOIExtractionPaint
public AlgorithmVOIExtractionPaint(ModelImage sourceImage, java.util.BitSet srcPaint, int xDimen, int yDimen, int zDimen, short voiID)
Construct the extractor for paint extraction to a VOI.- Parameters:
sourceImage
- the image that has been paintedsrcPaint
- the paint bitmapxDimen
- the x dimension of the imageyDimen
- the y dimension of the imagezDimen
- the z dimension of the imagevoiID
- the VOI number to give to the generated VOI
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
findPaintBorder
public java.util.Vector<java.awt.Polygon> findPaintBorder(int slice)
Finds a set of lines which surround the paint in the image.- Parameters:
slice
- the slice to find the paint borders on- Returns:
- DOCUMENT ME!
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
setPaintMask
public void setPaintMask(java.util.BitSet mask)
Changes the paint mask that we look for borders in.- Parameters:
mask
- the new mask to search through
-
calcInPlace
private void calcInPlace()
Calculates the VOI extraction.
-
setRegionMaskAll
private void setRegionMaskAll()
Sets the mask of all points in the 4 connected region with a gray scale value.
-
setRegionMaskI
private void setRegionMaskI(int xStart, int yStart, int offset)
Sets the mask of all points in the 4 connected region with a gray scale value of objectValue Uses iteration.- Parameters:
xStart
- the x coordinate of the starting pointyStart
- the y coordinate of the starting pointoffset
- offset into z plane of srcPaintMask
-
setRegionMaskIFalse
private void setRegionMaskIFalse(int xStart, int yStart, int offset)
Sets the mask of all points in the 4 connected region with a gray scale value of objectValue. Uses iteration.- Parameters:
xStart
- the x coordinate of the starting pointyStart
- the y coordinate of the starting pointoffset
- offset into z plane of srcPaintMask
-
setRegionOutMaskI
private void setRegionOutMaskI(int xStart, int yStart, int offset)
Sets the mask of all points in the 4 connected region with a srcPaintMask equal to false Uses iteration.- Parameters:
xStart
- the x coordinate of the starting pointyStart
- the y coordinate of the starting pointoffset
- offset into z plane of srcPaintMask
-
-