Class SchwarzChristoffelMapping

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.SchwarzChristoffelMapping
All Implemented Interfaces:
ActionListener, MouseListener, WindowListener, Runnable, EventListener

public class SchwarzChristoffelMapping extends AlgorithmBase implements MouseListener
  • Field Details

    • tolerance

      private double tolerance
    • eps

      private double eps
    • accessLock

      private final Lock accessLock
    • canProcessMouseClick

      private final Condition canProcessMouseClick
    • xClick

      private int xClick
    • yClick

      private int yClick
    • w

      private double[][] w
    • linhx

      Vector<Double>[][] linhx
    • linhy

      Vector<Double>[][] linhy
    • xSource

      private double[] xSource
    • ySource

      private double[] ySource
    • corners

      private int[] corners
    • POLYGON_TO_RECTANGLE

      private final int POLYGON_TO_RECTANGLE
      See Also:
    • POLYGON_TO_CIRCLE

      private final int POLYGON_TO_CIRCLE
      See Also:
    • CROSSRATIO_POLYGON_TO_CIRCLE

      private final int CROSSRATIO_POLYGON_TO_CIRCLE
      See Also:
    • POLYGON_EXTERIOR_TO_CIRCLE

      private final int POLYGON_EXTERIOR_TO_CIRCLE
      See Also:
    • CROSSRATIO_POLYGON_TO_RECTANGLE

      private final int CROSSRATIO_POLYGON_TO_RECTANGLE
      See Also:
    • algorithm

      private int algorithm
    • setCenter

      private boolean setCenter
    • xCenter

      private double xCenter
    • yCenter

      private double yCenter
    • crsplit_neww

      private double[][] crsplit_neww
    • crsplit_orig

      private boolean[] crsplit_orig
    • crtriang_edge

      private int[][] crtriang_edge
    • crtriang_triedge

      private int[][] crtriang_triedge
    • crtriang_edgetri

      private int[][] crtriang_edgetri
    • crparam_beta

      private double[] crparam_beta
    • crparam_cr

      private double[] crparam_cr
    • crparam_qdata

      private double[][] crparam_qdata
    • craffine_aff

      private double[][][] craffine_aff
    • craffine_wn

      private double[][] craffine_wn
    • crqgraph_Q

    • crfixwc_quadnum

      private int crfixwc_quadnum
    • crfixwc_mt

      private double[][] crfixwc_mt
    • crfixwc

      private double[] crfixwc
    • testRoutine

      private boolean testRoutine
    • exterRoutine

      private boolean exterRoutine
  • Constructor Details

    • SchwarzChristoffelMapping

      public SchwarzChristoffelMapping()
    • SchwarzChristoffelMapping

      public SchwarzChristoffelMapping(ModelImage destImg, ModelImage srcImg, double[][] w)
    • SchwarzChristoffelMapping

      public SchwarzChristoffelMapping(ModelImage destImg, ModelImage srcImg, double[] xSource, double[] ySource, int algorithm, boolean setCenter, double xCenter, double yCenter)
    • SchwarzChristoffelMapping

      public SchwarzChristoffelMapping(ModelImage destImg, ModelImage srcImg, double[] xSource, double[] ySource, int[] corners, int algorithm)
  • Method Details

    • runAlgorithm

      public void runAlgorithm()
      Description copied from class: AlgorithmBase
      Actually runs the algorithm. Implemented by inheriting algorithms.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • setEps

      public void setEps(double eps)
    • runPolygonToCircle

      public void runPolygonToCircle()
    • runCrossRatioPolygonToCircle

      public void runCrossRatioPolygonToCircle()
    • runPolygonExteriorToCircle

      public void runPolygonExteriorToCircle()
    • runPolygonToRectangle

      public void runPolygonToRectangle()
    • runCrossRatioPolygonToRectangle

      public void runCrossRatioPolygonToRectangle()
    • testRectmap1

      public void testRectmap1()
    • testRectmap2

      public void testRectmap2()
    • testRectmap3

      public void testRectmap3()
    • testDiskmap1

      public void testDiskmap1()
    • testDiskmap2

      public void testDiskmap2()
    • testDiskmap3

      public void testDiskmap3()
    • testDiskmap4

      public void testDiskmap4()
    • testDiskmap5

      public void testDiskmap5()
    • testDiskmap6

      public void testDiskmap6()
    • testDiskmap7

      public void testDiskmap7()
    • testCRDiskmap1

      public void testCRDiskmap1()
    • testCRDiskmap2

      public void testCRDiskmap2()
    • testCRDiskmap3

      public void testCRDiskmap3()
    • testCRDiskmap5

      public void testCRDiskmap5()
    • testCRDiskmap7

      public void testCRDiskmap7()
    • testExtermap1

      private void testExtermap1()
    • testExtermap2

      private void testExtermap2()
    • testCRRectmap1

      public void testCRRectmap1()
    • testCRRectmap2

      public void testCRRectmap2()
    • testCRRectmap3

      public void testCRRectmap3()
    • crdiskmap

      public SchwarzChristoffelMapping.scmap crdiskmap(SchwarzChristoffelMapping.polygon poly, double tolerance, double[][] cr, SchwarzChristoffelMapping.qlgraph Q)
    • crdiskCenter

      private SchwarzChristoffelMapping.scmap crdiskCenter(SchwarzChristoffelMapping.scmap M, double[] wc)
    • crdiskAccuracy

      private double crdiskAccuracy(SchwarzChristoffelMapping.scmap M)
    • crparam

      public void crparam(double[][] w, double[] beta, double[][] cr0, double tol)
    • crsplit

      private void crsplit(double[][] w)
    • crpsgd

      private void crpsgd(double[] d1, double[] d2, double[][] segment, double[][] pts1, double[][] pts2)
    • crtriang

      private void crtriang(double[][] w)
    • crpsdist

      private double[] crpsdist(double[][] segment, double[][] pts)
    • crcdt

      private void crcdt(double[][] w)
    • crqgraph

      private void crqgraph(double[][] w)
    • crossrat

      private double[][] crossrat(double[][] w, SchwarzChristoffelMapping.qlgraph Q)
    • craffine

      public void craffine(double[][] w, double[] beta, double[] cr, SchwarzChristoffelMapping.qlgraph Q, double tol)
    • crfixwc

      private void crfixwc(double[][] w, double[] beta, double[] cr, double[][][] aff, SchwarzChristoffelMapping.qlgraph Q, double[] wc)
    • crimap0

      private double[][] crimap0(double[][] wp, double[][] z, double[] beta, double[][] aff, double[][] qdat, boolean ode, boolean newton, double tol, int maxiter)
    • crmap0

      private double[][] crmap0(double[][] zp, double[][] z, double[] beta, double[][] aff, double[][] qdat)
    • extermap

      public SchwarzChristoffelMapping.scmap extermap(double[][] w, double[] alpha, double tolerance, double[][] z, double[] c)
    • diskmap

      public SchwarzChristoffelMapping.scmap diskmap(double[][] w, double[] alpha, double tolerance, double[][] z, double[] c)
    • exterAccuracy

      private double exterAccuracy(SchwarzChristoffelMapping.scmap M)
    • diskAccuracy

      private double diskAccuracy(SchwarzChristoffelMapping.scmap M)
    • center

      private SchwarzChristoffelMapping.scmap center(SchwarzChristoffelMapping.scmap map, double[] wc, double[][] z0)
    • rectevalinv

      private double[][] rectevalinv(SchwarzChristoffelMapping.scmap M, double[][] wp, double[][] tol, double[][] z0, int maxiter)
    • exteriorevalinv

      private double[][] exteriorevalinv(SchwarzChristoffelMapping.scmap M, double[][] wp, double[][] tol, double[][] z0, int maxiter)
    • diskevalinv

      private int[] diskevalinv(double[][] zp, SchwarzChristoffelMapping.scmap M, double[][] wp, double[][] tol, double[][] z0, int maxiter)
    • crdiskevalinv

      private double[][] crdiskevalinv(SchwarzChristoffelMapping.scmap M, double[][] wp, double tol)
    • crinvmap

      private double[][] crinvmap(double[][] wp, double[][] w, double[] beta, double[] cr, double[][][] aff, int quadnum, double[][] mt, SchwarzChristoffelMapping.qlgraph Q, double[][] qdat, boolean ode, boolean newton, double tol, int maxiter)
    • crgather

      private void crgather(double[][] u, int[] uquad, int quadnum, double[] cr, SchwarzChristoffelMapping.qlgraph Q, double[][][] zr)
    • rinvmap

      private double[][] rinvmap(double[][] wp, double[][] w, double[] beta, double[][] z, double[] c, double[] L, double[][] qdat, double[][] z0, boolean ode, boolean newton, double tol, int maxiter)
    • rectproject

      private double[][] rectproject(double[][] zp, double[] rect)
    • rderiv

      private double[][] rderiv(double[][] zp, double[][] z, double[] beta, double[] c, double[] L, double[][] zs)
    • deinvmap

      private double[][] deinvmap(double[][] wp, double[][] w, double[] beta, double[][] z, double[] c, double[][] qdat, double[][] z0, boolean ode, boolean newton, double tol, int maxiter)
    • dinvmap

      private int[] dinvmap(double[][] zp, double[][] wp, double[][] w, double[] beta, double[][] z, double[] c, double[][] qdat, double[][] z0, boolean ode, boolean newton, double tol, int maxiter)
    • diskevaldiff

      private double[][] diskevaldiff(SchwarzChristoffelMapping.scmap M, double[][] zp)
    • dederiv

      private double[][] dederiv(double[][] zp, double[][] z, double[] beta, double[] c)
    • dderiv

      private double[][] dderiv(double[][] zp, double[][] z, double[] beta, double[] c)
    • rectangle

      private double[][] rectangle(SchwarzChristoffelMapping.scmap M)
    • corners

      private int[] corners(SchwarzChristoffelMapping.scmap M)
    • scimapz0

      public void scimapz0(double[][] z0, double[][] w0, String prefix, double[][] wp, double[][] w, double[] beta, double[][] z, double[] c, double[][] qdat, double[][] aux)
    • hpmap

      public void hpmap(double[][] wp, double[][] zp, double[][] w, double[] beta, double[][] z, double[] c, double[][] qdat)
    • hpquad

      public double[][] hpquad(double[][] z1, double[][] z2, int[] sing1, double[][] z, double[] beta, double[][] qdat)
    • stmap

      public double[][] stmap(double[][] zp, double[][] w, double[] beta, double[][] z, double[] c, double[][] qdat)
    • diskeval

      private double[][] diskeval(SchwarzChristoffelMapping.scmap M, double[][] zp, double tol)
    • demap

      private double[][] demap(double[][] zp, double[][] w, double[] beta, double[][] z, double[] c, double[][] qdat)
    • dmap

      private double[][] dmap(double[][] zp, double[][] w, double[] beta, double[][] z, double[] c, double[][] qdat)
    • crrectmap

      public SchwarzChristoffelMapping.scmap crrectmap(double[][] w, int[] corner, double tolerance)
    • crrect

      public void crrect(double[][] wr, double[][][] affr, double[][] w, double[] beta, double[] cr, double[][][] aff, SchwarzChristoffelMapping.qlgraph Q, double[] betar, double tol)
    • rectmap

      public SchwarzChristoffelMapping.scmap rectmap(double[][] w, int[] corner, double tolerance, double[][] z, double[] c, double[] L)
    • crdiskplot

      public void crdiskplot(SchwarzChristoffelMapping.scmap M, double[] R, double[] theta, int num1draw, int num2draw, boolean drawThetaToRadiusOne, double[] error, int yInvert)
    • exterplot

      public void exterplot(SchwarzChristoffelMapping.scmap M, double[] R, double[] theta, int num1draw, int num2draw, double[] error, int yInvert, double[] axis)
    • diskplot

      public void diskplot(SchwarzChristoffelMapping.scmap M, double[] R, double[] theta, int num1draw, int num2draw, double[] error, int yInvert)
    • crplot

      private void crplot(double[][] w, double[] beta, double[] cr, double[][][] aff, int quadnum, double[][] mt, SchwarzChristoffelMapping.qlgraph Q, double[] R, double[] theta, int nqpts, int num1draw, int num2draw, boolean drawThetaToRadiusOne, int yInvert)
    • crmap

      private double[][] crmap(double[][] zp, double[][] w, double[] beta, double[] cr, double[][][] aff, int quadnum, double[][] mt, SchwarzChristoffelMapping.qlgraph Q, double[][] qdat)
    • crspread

      private void crspread(double[][][] ul, double[][][] dl, double[][] u, int quadnum, double[] cr, SchwarzChristoffelMapping.qlgraph Q)
    • moebius

      private double[][] moebius(double[][] z, double[][] w)
    • deplot

      private void deplot(double[][] w, double[] beta, double[][] z, double[] c, double[] R, double[] theta, int nqpts, int num1draw, int num2draw, int yInvert, double[] axis)
    • dplot

      private void dplot(double[][] w, double[] beta, double[][] z, double[] c, double[] R, double[] theta, int nqpts, int num1draw, int num2draw, int yInvert)
    • crrectplot

      public void crrectplot(SchwarzChristoffelMapping.scmap M, double[] nre, double[] nim, int yInvert)
    • rectplot

      public void rectplot(SchwarzChristoffelMapping.scmap M, int nre, int nim, int yInvert)
    • crrplot

      public void crrplot(double[][] w, double[] beta, double[][] wr, double[] betar, double[] cr, double[][][] aff, double[][][] affr, SchwarzChristoffelMapping.qlgraph Q, double[] re, double[] im, int yInvert)
    • crrplot0

      private void crrplot0(String direcn, double[] val, double minlen, double maxlen, int maxrefn, double tol, double[][] w, double[] beta, double[][] wr, double[] betar, double[] cr, double[][][] aff, double[][][] affr, SchwarzChristoffelMapping.qlgraph Q, double[][] qdat, double[][] qdatr, double[] axlim, double siz, Vector<Double>[][] linhx, Vector<Double>[][] linhy)
    • crrsort

      private void crrsort(Vector<Double>[] wpReal, Vector<Double>[] wpImag, int[][] qnum, SchwarzChristoffelMapping.qlgraph Q)
    • crrmap

      public void crrmap(double[][][] wp, int[][] qnum, double[][] zp, double[][] w, double[] beta, double[][] wr, double[] betar, double[] cr, double[][][] aff, double[][][] affr, SchwarzChristoffelMapping.qlgraph Q, double[][] qdat, double[][] qdatr)
    • rplot

      private void rplot(double[][] w, double[] beta, double[][] z, double[] c, double[] L, int re, int im, int yInvert)
    • scpadapt

      public void scpadapt(Vector<Double> zpReal, Vector<Double> zpImag, Vector<Double> wpReal, Vector<Double> wpImag, Vector<Boolean> newlog, double minlen, double maxlen, double[] clip)
    • scpadapt2

      private double[][][] scpadapt2(Vector<Double> zpReal, Vector<Double> zpImag, Vector<Double>[] wpReal, Vector<Double>[] wpImag, Vector<Boolean> newlog, double minlen, double maxlen, double[] clip)
    • rmap

      private void rmap(double[][] wp, double[][] zp, double[][] w, double[] beta, double[][] z, double[] c, double[] L, double[][] qdat)
    • stmap

      private void stmap(double[][] wp, double[][] zp, double[][] w, double[] beta, double[][] z, double[] c, double[][] qdat)
    • plotpoly

      public ViewJFrameGraph plotpoly(float[] xPointArray, float[] yPointArray, double[][] w, double[] beta, boolean addMarkerLabel, double[] axlim, int yInvert, boolean closed, double[] axis)
    • rectAccuracy

      private double rectAccuracy(SchwarzChristoffelMapping.scmap M)
    • rcorners

      private void rcorners(double[][] w, double[] beta, double[][] z, int[] corners, int[] renum)
    • angle

      public void angle(double[] alpha, boolean[] isccw, int[] index, double[][] w, double[] angle)
    • isinpoly

      private void isinpoly(boolean[] indexout, boolean[][] onvtx, double[][] z, double[][] w, double[] beta, double tol)
    • isinpoly2

      private void isinpoly2(int[] indexout, boolean[][] onvtx, double[][] z, double[][] w, double[] beta, double tol)
    • scangle

      private double[] scangle(double[][] w)
    • deparam

      private void deparam(double[][] z, double[] c, double[][] qdat, double[][] w, double[] beta, double[][] z0, double tol)
    • dparam

      private void dparam(double[][] z, double[] c, double[][] qdat, double[][] w, double[] beta, double[][] z0, double tol)
    • rparam

      private void rparam(double[][] z, double[] c, double[] L, double[][] qdat, double[][] w, double[] beta, int[] cnr, double[][] z0, double tol)
    • scselect

      public int[] scselect(double[][] w, double[] beta, int m, String titl, String[] msg)
    • mouseClicked

      public void mouseClicked(MouseEvent mouseEvent)
      Specified by:
      mouseClicked in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent event)
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent event)
      Specified by:
      mouseReleased in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent event)
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent event)
      Specified by:
      mouseExited in interface MouseListener
    • r2strip

      private void r2strip(double[][] yp, double[][] yprime, double[][] zp, double[][] z, double L)
    • ellipjc

      private void ellipjc(double[][] sn, double[][] cn, double[][] dn, double[][] u, double L, boolean flag)
    • ellipkkp

      private void ellipkkp(double[] K, double[] Kp, double L)
    • printExitStatus

      public void printExitStatus(int exitStatus)
    • dequad

      private double[][] dequad(double[][] z1, double[][] z2, int[] sing1, double[][] z, double[] beta, double[][] qdat)
    • dquad

      private double[][] dquad(double[][] z1, double[][] z2, int[] sing1, double[][] z, double[] beta, double[][] qdat)
    • dabsquad

      private double[][] dabsquad(double[][] z1, double[][] z2, int[] sing1, double[][] z, double[] beta, double[][] qdat)
    • crembed

      private double[][] crembed(double[] cr, SchwarzChristoffelMapping.qlgraph Q, int qnum)
    • crquad

      private double[][] crquad(double[][] z1, int[] sing1, double[][] z, double[] beta, double[][] qdat)
    • zdiv

      public void zdiv(double ar, double ai, double br, double bi, double[] cr, double[] ci)
      complex divide c = a/b.
      Parameters:
      ar - double
      ai - double
      br - double
      bi - double
      cr - double[]
      ci - double[]
    • zabs

      public double zabs(double zr, double zi)
      zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.
      Parameters:
      zr - double
      zi - double
      Returns:
      double
    • zmlt

      public void zmlt(double ar, double ai, double br, double bi, double[] cr, double[] ci)
      complex multiply c = a * b.
      Parameters:
      ar - double
      ai - double
      br - double
      bi - double
      cr - double[]
      ci - double[]
    • stquadh

      public double[][] stquadh(double[][] z1, double[][] z2, int[] sing1, double[][] z, double[] beta, double[][] qdat)
    • stquad

      public double[][] stquad(double[][] z1, double[][] z2, int[] sing1, double[][] z, double[] beta, double[][] qdat)
    • stderiv

      public double[][] stderiv(double[][] zp, double[][] z, double[] beta, double[] c, int j)
    • sign

      public double sign(double d)
    • sign

      private double[] sign(double dReal, double dImag)
    • rptrnsfm

      private void rptrnsfm(double[][] z, double[] y, int[] cnr)
    • scqdata

      public void scqdata(double[][] qdat, double[] beta, int nqpts)
    • gaussj

      private void gaussj(double[] z, double[] w, int n, double alf, double bet)
    • sccheck

      public int sccheck(String type, double[][] w, double[] beta, int[] aux)
    • scfix

      public void scfix(double[][] wn, double[] betan, int[] verticesAdded, int[] auxn, String type, double[][] w, double[] beta, int[] aux)
    • scaddvtx

      private void scaddvtx(double[][] wn, double[] betan, double[][] w, double[] beta, int pos, double[] window)
    • isFinite

      private static final boolean isFinite(double d)