Package gov.nih.mipav.model.algorithms
Class AlgorithmBSmooth
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmBSmooth
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
Smoothing of VOI using 1 iteration of bSplines. All selected curves in all slices of the voi will be smoothed. The
number of interpolated points is user selectable. The user chooses whether or not to trim out nearly collinear
points. The user chooses whether or not to remove the original selected curve. If the original curve is not removed,
the new curve will have a different color. If the original curve is removed, the new curve will have the same color.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate VOIThe voi selected by the user.private AlgorithmBSplineprivate intNumber of interpolation points.private VOIThe resultant polygon and the evolution has completed.private ModelImageSource image.private booleanTrim out nearly collinear points.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
ConstructorsConstructorDescriptionAlgorithmBSmooth(ModelImage srcImg, VOI activeVOI, int nPts, boolean trim) Creates a new AlgorithmBSmooth object. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcalc2D()Prepares the data and runs the algorithm for a 2D image.private voidcalc3D()Prepares the data and runs the algorithm for a 3D image.voidfinalize()Prepares this class for destruction.Accessor that returns a voi that is a smoothed version of the original.voidStarts the smooth algorithm.voidActual function that smooths the voi with bsplines.private voidrunSmooth2(float[] xPoints, float[] yPoints, float[] zPoints) Actual function that smooths the voi with bsplines.voidsetNPts(int nPts) voidTakes the polygon and forms two special arrays for use in the Bspline.private voidsetPoints2(float[] xPoints, float[] yPoints, float[] zPoints) Takes the polygon and forms two special arrays for use in the Bspline.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
-
activeVOI
The voi selected by the user. -
nPts
private int nPtsNumber of interpolation points. -
resultVOI
The resultant polygon and the evolution has completed. -
srcImage
Source image. -
trim
private boolean trimTrim out nearly collinear points. -
bSpline
-
-
Constructor Details
-
AlgorithmBSmooth
public AlgorithmBSmooth() -
AlgorithmBSmooth
Creates a new AlgorithmBSmooth object.- Parameters:
srcImg- 2D or 3D source imageactiveVOI- the selected voinPts- number of interpolation pointstrim- trim out nearly collinear points
-
-
Method Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
getResultVOI
Accessor that returns a voi that is a smoothed version of the original.- Returns:
- resultVOI
-
setNPts
public void setNPts(int nPts) -
runAlgorithm
public void runAlgorithm()Starts the smooth algorithm.- Specified by:
runAlgorithmin classAlgorithmBase
-
calc2D
private void calc2D()Prepares the data and runs the algorithm for a 2D image. -
calc3D
private void calc3D()Prepares the data and runs the algorithm for a 3D image. -
runSmooth2
private void runSmooth2(float[] xPoints, float[] yPoints, float[] zPoints) Actual function that smooths the voi with bsplines.- Parameters:
xPoints- x coordinates that describe the contouryPoints- y coordinates that describe the contourresultGon- resultant polygon
-
runSmooth
Actual function that smooths the voi with bsplines.- Parameters:
xPoints- x coordinates that describe the contouryPoints- y coordinates that describe the contourresultGon- resultant polygon
-
setPoints
Takes the polygon and forms two special arrays for use in the Bspline.- Parameters:
xPoints- storage location of array of x coord. pointsyPoints- storage location array of y coord. pointsgon- initial polygon
-
setPoints2
private void setPoints2(float[] xPoints, float[] yPoints, float[] zPoints) Takes the polygon and forms two special arrays for use in the Bspline.- Parameters:
xPoints- storage location of array of x coord. pointsyPoints- storage location array of y coord. pointsgon- initial polygon
-
getbSplineAlgo
-