Package gov.nih.mipav.model.algorithms
Class AlgorithmEllipseToCircle
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmEllipseToCircle
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
This program performs the conformal mapping of an ellipse to a circle.
Consider the original ellipse as having a tilt theta with the x axis.
Then the conformal mapping is done in 3 steps.
1.) Translate the circle from the center of the square image to the origin,
rotate around the circle by -theta and convert to a unit disc by dividing the distance
from the center by the radius.
2.) Map from the unit circle to a standard ellipse on the x axis with foci at +- 1 and
with the same major axis/minor axis ratio as the original ellipse.
3.) Map from the standard ellipse to the original ellipse by rotating, scaling, and translating.
References: 1.) Advanced Calculus For Applications Second Edition by F. B. Hildebrand, Section 10.4 Analytic Functions of a Complex Variable pages 550-554 and Section 11.4 Conformal Mapping pages 628-632, Prentice-Hall, Inc., 1976. 2.) "On Conformal Representations of the Interior of an Ellipse" by Stanislawa Kanas and Toshiyuki Sugawa, Annales Academiae Scientiarum Fennicae Mathematica, Volume 31, 2006, pp. 329-348. 3.) http://mathworld.com/InverseSine.html
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
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
ConstructorsConstructorDescriptionAlgorithmEllipseToCircle - default constructor.AlgorithmEllipseToCircle(ModelImage destImg, ModelImage srcImg) AlgorithmEllipseToCircle. -
Method Summary
Modifier and TypeMethodDescriptionprivate doublecosh(double x) voidfinalize()finalize -voidStarts the program.private voidselfTest()private doublesinh(double x) private voidsqrtc(double zinr, double zini, double[] zsqr, double[] zsqi) private doublezabs(double zr, double zi) zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.private voidzlog(double ar, double ai, double[] br, double[] bi, int[] ierr) complex logarithm b = clog(a).private voidzmlt(double ar, double ai, double br, double bi, double[] cr, double[] ci) complex multiply c = a * b.private voidzsin(double inr, double ini, double[] outr, double[] outi) 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
-
Constructor Details
-
AlgorithmEllipseToCircle
public AlgorithmEllipseToCircle()AlgorithmEllipseToCircle - default constructor. -
AlgorithmEllipseToCircle
AlgorithmEllipseToCircle.- Parameters:
destImg- DOCUMENT ME!srcImg- DOCUMENT ME!
-
-
Method Details
-
finalize
public void finalize()finalize -- Overrides:
finalizein classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()Starts the program.- Specified by:
runAlgorithmin classAlgorithmBase
-
zmlt
private void zmlt(double ar, double ai, double br, double bi, double[] cr, double[] ci) complex multiply c = a * b.- Parameters:
ar- doubleai- doublebr- doublebi- doublecr- double[]ci- double[]
-
sqrtc
private void sqrtc(double zinr, double zini, double[] zsqr, double[] zsqi) -
zabs
private double zabs(double zr, double zi) zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.- Parameters:
zr- doublezi- double- Returns:
- double
-
zlog
private void zlog(double ar, double ai, double[] br, double[] bi, int[] ierr) complex logarithm b = clog(a).- Parameters:
ar- doubleai- doublebr- double[]bi- double[]ierr- int[] ierr = 0, normal return ierr = 1, z = cmplx(0.0, 0.0)
-
zsin
private void zsin(double inr, double ini, double[] outr, double[] outi) -
cosh
private double cosh(double x) -
sinh
private double sinh(double x) -
selfTest
private void selfTest()
-