Class AlgorithmNearlyCircleToCircle
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmNearlyCircleToCircle
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmNearlyCircleToCircle extends AlgorithmBase
This program performs the conformal mapping of a nearly circular region to a circle. The conformal mapping is done in 3 steps: 1.) Translate the circle from the center of the square image to the origin and convert to a unit disc by dividing the distance from the center by the radius. 2.) Map from the unit circle to a unit nearly circular region at the origin. 3.) Map from the unit nearly circlular region at the origin to the original nearly circular region by 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.) Conformal Mapping by Zeev Nehari, Dover Publications, Inc., 1952, Chapter V, Conformal Mapping of Simply Connected Domains, Section 11, Conformal Mapping of Nearly Circular Domains, pp. 263 - 265. 3.) "On the Conformal Mapping of Nearly-Circular Domains" by Zeev Nehari and Vikramaditya Singh, Proceedings of the American Mathematical Society, 1956, pp. 370-378. According to the Nehari book: The function: F(z) = z + ((eps*z)/(2*PI))*Integral from 0 to 2*PI of ((exp(i*theta) + z)/(exp(i*theta) - z))*p(theta)d(theta) maps abs(z) < 1 onto the nearly circular domain whose boundary has the polar equation r = 1 + eps*p(theta), where p(theta) is bounded and piecewise continuous and eps is a small positive parameter. The Nehari article further assumes: p(theta) > 0. Multiply both the numerator and the denominator of the integral by (exp(i*theta) - z)* = (exp(-i*theta) - z*) to create a real denominator denom = 1 - 2xcos(theta) - 2ysin(theta) + x**2 + y**2 The real part of the integral equals: Integral from 0 to 2*PI of ((1 - x**2 - y**2)/denom)p(theta)d(theta) The imaginary part of the integral equals: Integral from 0 to 2*PI of ((-2xsin(theta) + 2ycos(theta))/denom)p(theta)d(theta) 0 to 2*PI direction would be counterclockwise. Suppose curve is clockwise, then the theta increments are negative. So both a counterclockwise integral and the negative of the clockwise integral are realized by taking the absolute value of the theta angle increment.
-
-
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 AlgorithmNearlyCircleToCircle()
AlgorithmNearlyCircleToCircle - default constructor.AlgorithmNearlyCircleToCircle(ModelImage destImg, ModelImage srcImg)
AlgorithmNearlyCircleToCircle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
finalize -void
runAlgorithm()
Starts the program.private void
selfTest()
private void
zmlt(double ar, double ai, double br, double bi, double[] cr, double[] ci)
complex multiply c = a * b.-
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
-
AlgorithmNearlyCircleToCircle
public AlgorithmNearlyCircleToCircle()
AlgorithmNearlyCircleToCircle - default constructor.
-
AlgorithmNearlyCircleToCircle
public AlgorithmNearlyCircleToCircle(ModelImage destImg, ModelImage srcImg)
AlgorithmNearlyCircleToCircle.- 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[]
-
selfTest
private void selfTest()
-
-