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 VOIaddedVOIDOCUMENT ME!private intexpandedLength(xDim2+2)*(yDim2+2)private intlengthxDim2*yDim2.private java.util.BitSetmaskDOCUMENT ME!private java.util.BitSetmask2DOCUMENT ME!private java.util.BitSetmaskAllDOCUMENT ME!private java.util.BitSetmaskEDOCUMENT ME!private java.util.BitSetmaskExpandedprivate int[][]maskListDOCUMENT ME!private java.util.BitSetmaskNDOCUMENT ME!private java.util.BitSetmaskSDOCUMENT ME!private java.util.BitSetmaskWDOCUMENT ME!private intneighborsDOCUMENT ME!private int[][]nextMaskListDOCUMENT ME!private java.util.BitSetoutMaskDOCUMENT ME!private intsmallLengthxDim * yDim.private intsmallPosDOCUMENT ME!private intsmallPos3DDOCUMENT ME!private intsmallXDOCUMENT ME!private intsmallYDOCUMENT ME!private ModelImagesrcImageDOCUMENT ME!private java.util.BitSetsrcPaintMaskDOCUMENT ME!private inttestPosx + y*xDim.private shortvoiIDnumDOCUMENT ME!private intxcurrent x position.private intxDimDOCUMENT ME!private intxDim2DOCUMENT ME!private intxDim4DOCUMENT ME!private intxtDOCUMENT ME!private intycurrent y position.private intyDimDOCUMENT ME!private intyDim2DOCUMENT ME!private intytDOCUMENT ME!private intzcurrent z slice.private intzDimextent 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 voidcalcInPlace()Calculates the VOI extraction.voidfinalize()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.voidrunAlgorithm()Starts the program.voidsetPaintMask(java.util.BitSet mask)Changes the paint mask that we look for borders in.private voidsetRegionMaskAll()Sets the mask of all points in the 4 connected region with a gray scale value.private voidsetRegionMaskI(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 voidsetRegionMaskIFalse(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 voidsetRegionOutMaskI(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:
finalizein 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:
runAlgorithmin 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
-
-