Package gov.nih.mipav.model.algorithms
Class AlgorithmMinimumPerimeterPolygon
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmMinimumPerimeterPolygon
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmMinimumPerimeterPolygon extends AlgorithmBase
Smoothing VOI with minimum perimeter polygon. References: 1.) Digital ImageProcessing Fourth Edition, Rafael C. Gonzalez and Richard E. Woods, Boundary Approximations Using Minimum-Perimeter Polygons, pp. 963-968.- Author:
- ilb
-
-
Field Summary
Fields Modifier and Type Field Description private VOIactiveVOIThe voi selected by the user.private VOIresultVOIThe resultant polygon and the evolution has completed.private intsquareCellLengthSquare cell length.private ModelImagesrcImageSource image.-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmMinimumPerimeterPolygon()AlgorithmMinimumPerimeterPolygon(ModelImage srcImg, VOI activeVOI, int squareCellLength)Creates a new AlgorithmMinimumPerimeterPolygon object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcalc()Prepares the data and runs the algorithm for a 2D or 3D image.private doubledet(double x1, double x2, double x3, double y1, double y2, double y3)voidfinalize()Prepares this class for destruction.VOIgetResultVOI()Accessor that returns a voi that is a smoothed version of the original.voidrunAlgorithm()Starts the smooth algorithm.-
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
-
activeVOI
private VOI activeVOI
The voi selected by the user.
-
squareCellLength
private int squareCellLength
Square cell length.
-
resultVOI
private VOI resultVOI
The resultant polygon and the evolution has completed.
-
srcImage
private ModelImage srcImage
Source image.
-
-
Constructor Detail
-
AlgorithmMinimumPerimeterPolygon
public AlgorithmMinimumPerimeterPolygon()
-
AlgorithmMinimumPerimeterPolygon
public AlgorithmMinimumPerimeterPolygon(ModelImage srcImg, VOI activeVOI, int squareCellLength)
Creates a new AlgorithmMinimumPerimeterPolygon object.- Parameters:
srcImg- 2D or 3D source imageactiveVOI- the selected voisquareCellLength- square cell length
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
getResultVOI
public VOI getResultVOI()
Accessor that returns a voi that is a smoothed version of the original.- Returns:
- resultVOI
-
runAlgorithm
public void runAlgorithm()
Starts the smooth algorithm.- Specified by:
runAlgorithmin classAlgorithmBase
-
calc
private void calc()
Prepares the data and runs the algorithm for a 2D or 3D image.
-
det
private double det(double x1, double x2, double x3, double y1, double y2, double y3)
-
-