Package gov.nih.mipav.model.algorithms
Class AlgorithmArcLength
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmArcLength
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
This algorithm calculates the arc-length of a Bspline fit to user defined control points. This algorithm calculates
the entire curve length and also is able to calculate the arc-length between two points.
- Version:
- 0.1 April 27, 1998
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AlgorithmBSplineDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final floatDOCUMENT ME!private float[][]DOCUMENT ME!private floatDOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmArcLength(float[] xPts, float[] yPts) Algorithm constructor.AlgorithmArcLength(float[] xPts, float[] yPts, float[] zPts) Algorithm constructor. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns total arc-length of the segment.floatinvlen(float pct) Finds the point at some percentage along the curve using simple midpoint root finding algorithm.floatinvlenNewton(float pct) Finds the point at some percentage along the curve using Newtons method of root finding.floatlength(float a, float b) The length is calculated between to points a,b using Romberg integration.voidDOCUMENT ME!voidsetPoints(float[] xPts, float[] yPts) Sets the controls points of the Bspline and calculates the total arc-length.voidsetPoints(float[] xPts, float[] yPts, float[] zPts) Sets the controls points of the Bspline and calculates the total arc-length.private floatspeed(float q) Calculates the speed at some point q.Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, 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
-
INTEGRAL_ORDER
public static final int INTEGRAL_ORDERDOCUMENT ME!- See Also:
-
INVLEN_MAXITER
public static final int INVLEN_MAXITERDOCUMENT ME!- See Also:
-
INVLEN_TOLERANCE
public static final float INVLEN_TOLERANCEDOCUMENT ME!- See Also:
-
bSpline
DOCUMENT ME! -
rom
private float[][] romDOCUMENT ME! -
totalLen
private float totalLenDOCUMENT ME! -
xPoints
private float[] xPointsDOCUMENT ME! -
yPoints
private float[] yPointsDOCUMENT ME! -
zPoints
private float[] zPointsDOCUMENT ME!
-
-
Constructor Details
-
AlgorithmArcLength
public AlgorithmArcLength(float[] xPts, float[] yPts) Algorithm constructor.- Parameters:
xPts- x coordinate control pointsyPts- y coordinate control points
-
AlgorithmArcLength
public AlgorithmArcLength(float[] xPts, float[] yPts, float[] zPts) Algorithm constructor.- Parameters:
xPts- x coordinate control pointsyPts- y coordinate control points
-
-
Method Details
-
getTotalArcLength
public float getTotalArcLength()Returns total arc-length of the segment.- Returns:
- DOCUMENT ME!
-
invlen
public float invlen(float pct) Finds the point at some percentage along the curve using simple midpoint root finding algorithm.- Parameters:
pct- percentage indicating where one would- Returns:
- position indicates
-
invlenNewton
public float invlenNewton(float pct) Finds the point at some percentage along the curve using Newtons method of root finding.- Parameters:
pct- percentage indicating where one would- Returns:
- position indicates
-
runAlgorithm
public void runAlgorithm()DOCUMENT ME!- Specified by:
runAlgorithmin classAlgorithmBase
-
setPoints
public void setPoints(float[] xPts, float[] yPts) Sets the controls points of the Bspline and calculates the total arc-length.- Parameters:
xPts- x coordinate control pointsyPts- y coordinate control points
-
setPoints
public void setPoints(float[] xPts, float[] yPts, float[] zPts) Sets the controls points of the Bspline and calculates the total arc-length.- Parameters:
xPts- x coordinate control pointsyPts- y coordinate control points
-
length
public float length(float a, float b) The length is calculated between to points a,b using Romberg integration.- Parameters:
a- starting positionb- ending position b > a and b range- Returns:
- length returns arc-length of the segment
-
speed
private float speed(float q) Calculates the speed at some point q.- Parameters:
q- the point where the speed is calculated- Returns:
- speed the speed ( magnitude ) is returned
-