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:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmEllipseToCircle extends AlgorithmBase
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
-
-
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, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmEllipseToCircle()
AlgorithmEllipseToCircle - default constructor.AlgorithmEllipseToCircle(ModelImage destImg, ModelImage srcImg)
AlgorithmEllipseToCircle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double
cosh(double x)
void
finalize()
finalize -void
runAlgorithm()
Starts the program.private void
selfTest()
private double
sinh(double x)
private void
sqrtc(double zinr, double zini, double[] zsqr, double[] zsqi)
private double
zabs(double zr, double zi)
zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.private void
zlog(double ar, double ai, double[] br, double[] bi, int[] ierr)
complex logarithm b = clog(a).private void
zmlt(double ar, double ai, double br, double bi, double[] cr, double[] ci)
complex multiply c = a * b.private void
zsin(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, 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
-
-
-
-
Constructor Detail
-
AlgorithmEllipseToCircle
public AlgorithmEllipseToCircle()
AlgorithmEllipseToCircle - default constructor.
-
AlgorithmEllipseToCircle
public AlgorithmEllipseToCircle(ModelImage destImg, ModelImage srcImg)
AlgorithmEllipseToCircle.- Parameters:
destImg
- DOCUMENT ME!srcImg
- DOCUMENT ME!
-
-
Method Detail
-
finalize
public void finalize()
finalize -- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in 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()
-
-