OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / src / Objects / DataManip / mrcImage / src / lmrcImageSoftEdge.c
index 2f159a7..4afe3a5 100644 (file)
@@ -33,6 +33,8 @@ lmrcImageSoftEdge(mrcImage* out, mrcImage* in, lmrcImageSoftEdgeInfo linfo, int
     mrcImage dilation, tmp; 
     lmrcImageMorphologyInfo minfo;
     int times;
+    int flagNear;
+
     DEBUGPRINT("lmrcImageSoftEdge\n");
     out->Header = in->Header;
     mrcInit(out, NULL);
@@ -65,8 +67,9 @@ lmrcImageSoftEdge(mrcImage* out, mrcImage* in, lmrcImageSoftEdgeInfo linfo, int
     do { 
         lmrcImageDilation(&dilation, &tmp, minfo, 2);
         tmp = dilation;
+        times++;
     } while(times<=width);
-#ifdef DEBUG
+#ifdef DEBUG2
     mrcFileWrite(&dilation, "/tmp/test.dilation", "for test", 0); 
     mrcFileWrite(&minfo.SE, "/tmp/test.se", "for test", 0); 
 #endif
@@ -82,6 +85,7 @@ lmrcImageSoftEdge(mrcImage* out, mrcImage* in, lmrcImageSoftEdgeInfo linfo, int
             //DEBUGPRINT5("%f %f %f: %f %f\n", x, y, z, data0, data);
             near = max;
             dstData = 0;
+            flagNear=1;
             for(tmpWidth=1; tmpWidth<=width; tmpWidth++) { 
                 xmin = MAX(0, x-tmpWidth); xmax = MIN(x+tmpWidth, out->HeaderN.x - 1); 
                 ymin = MAX(0, y-tmpWidth); ymax = MIN(y+tmpWidth, out->HeaderN.y - 1);
@@ -99,22 +103,14 @@ lmrcImageSoftEdge(mrcImage* out, mrcImage* in, lmrcImageSoftEdgeInfo linfo, int
                                 neary = offsety;
                                 nearz = offsetz;
                                 dstData = data;
+                                flagNear+;
                             }
                         }
                     }
-                    if(dstData) {
-                        break;
-                    }
                 }
-                    if(dstData) {
-                        break;
-                    }
                 }
-                    if(dstData) {
-                        break;
-                    }
                 }
-                if(dstData) {
+                if(0<flagNear) {
                     break;
                 }
             }