In runPolygonToCircle reduced size of zp put into dmap, in runCrossRatioPolygonToCirc...
authorilb@NIH.GOV <ilb@NIH.GOV@ba61647d-9d00-f842-95cd-605cb4296b96>
Fri, 8 Dec 2017 22:43:06 +0000 (22:43 +0000)
committerilb@NIH.GOV <ilb@NIH.GOV@ba61647d-9d00-f842-95cd-605cb4296b96>
Fri, 8 Dec 2017 22:43:06 +0000 (22:43 +0000)
git-svn-id: https://citdcbmipav.cit.nih.gov/repos-pub/mipav/trunk@15302 ba61647d-9d00-f842-95cd-605cb4296b96

mipav/src/gov/nih/mipav/model/algorithms/SchwarzChristoffelMapping.java

index a6d659a..e8f93f4 100644 (file)
@@ -294,7 +294,7 @@ public class SchwarzChristoffelMapping extends AlgorithmBase implements MouseLis
                double xcenterDest = (xDimDest-1.0)/2.0;\r
                double ycenterDest = (yDimDest-1.0)/2.0;\r
                double maxDistance = Math.min(xcenterDest,ycenterDest);\r
-               zp = new double[destSlice][2];\r
+               //zp = new double[destSlice][2];\r
                boolean idx[] = new boolean[destSlice];\r
                j = 0;\r
         for (y = 0; y < yDimDest; y++) {\r
@@ -304,6 +304,18 @@ public class SchwarzChristoffelMapping extends AlgorithmBase implements MouseLis
                        double distY = (y-ycenterDest)/maxDistance;\r
                        if ((distX*distX + distY*distY) < 1.0) {\r
                                idx[index] = true;\r
+                               j++;\r
+                       }\r
+               }\r
+        } // for (y = 0; y < yDimDest; y++)\r
+        zp = new double[j][2];\r
+        j = 0;\r
+        for (y = 0; y < yDimDest; y++) {\r
+               for (x = 0; x < xDimDest; x++) {\r
+                       index = x + xDimDest*y;\r
+                       double distX = (x-xcenterDest)/maxDistance;\r
+                       double distY = (y-ycenterDest)/maxDistance;\r
+                       if ((distX*distX + distY*distY) < 1.0) {\r
                                zp[j][0] = distX;\r
                                zp[j][1] = distY;\r
                                j++;\r
@@ -518,7 +530,6 @@ public class SchwarzChristoffelMapping extends AlgorithmBase implements MouseLis
                double xcenterDest = (xDimDest-1.0)/2.0;\r
                double ycenterDest = (yDimDest-1.0)/2.0;\r
                double maxDistance = Math.min(xcenterDest,ycenterDest);\r
-               zp = new double[destSlice][2];\r
                boolean idx[] = new boolean[destSlice];\r
                j = 0;\r
         for (y = 0; y < yDimDest; y++) {\r
@@ -528,6 +539,18 @@ public class SchwarzChristoffelMapping extends AlgorithmBase implements MouseLis
                        double distY = (y-ycenterDest)/maxDistance;\r
                        if ((distX*distX + distY*distY) < 1.0) {\r
                                idx[index] = true;\r
+                               j++;\r
+                       }\r
+               }\r
+        } // for (y = 0; y < yDimDest; y++)\r
+        zp = new double[j][2];\r
+        j = 0;\r
+        for (y = 0; y < yDimDest; y++) {\r
+               for (x = 0; x < xDimDest; x++) {\r
+                       index = x + xDimDest*y;\r
+                       double distX = (x-xcenterDest)/maxDistance;\r
+                       double distY = (y-ycenterDest)/maxDistance;\r
+                       if ((distX*distX + distY*distY) < 1.0) {\r
                                zp[j][0] = distX;\r
                                zp[j][1] = distY;\r
                                j++;\r
@@ -740,7 +763,6 @@ public class SchwarzChristoffelMapping extends AlgorithmBase implements MouseLis
                double xcenterDest = (xDimDest-1.0)/2.0;\r
                double ycenterDest = (yDimDest-1.0)/2.0;\r
                double maxDistance = Math.min(xcenterDest,ycenterDest);\r
-               zp = new double[destSlice][2];\r
                boolean idx[] = new boolean[destSlice];\r
                j = 0;\r
         for (y = 0; y < yDimDest; y++) {\r
@@ -750,6 +772,18 @@ public class SchwarzChristoffelMapping extends AlgorithmBase implements MouseLis
                        double distY = (y-ycenterDest)/maxDistance;\r
                        if ((distX*distX + distY*distY) < 1.0) {\r
                                idx[index] = true;\r
+                               j++;\r
+                       }\r
+               }\r
+        } // for (y = 0; y < yDimDest; y++)\r
+        zp = new double[j][2];\r
+        j = 0;\r
+        for (y = 0; y < yDimDest; y++) {\r
+               for (x = 0; x < xDimDest; x++) {\r
+                       index = x + xDimDest*y;\r
+                       double distX = (x-xcenterDest)/maxDistance;\r
+                       double distY = (y-ycenterDest)/maxDistance;\r
+                       if ((distX*distX + distY*distY) < 1.0) {\r
                                zp[j][0] = distX;\r
                                zp[j][1] = distY;\r
                                j++;\r
@@ -1124,8 +1158,6 @@ public class SchwarzChristoffelMapping extends AlgorithmBase implements MouseLis
                double imageMin;\r
                int y;\r
                int x;\r
-               double z[][];\r
-           int MCorners[];\r
            double zr[][];\r
            double wpinpoly[][][];\r
                double zp[][];\r