From: Takuo Yasunaga Date: Fri, 16 Dec 2022 10:24:46 +0000 (+0900) Subject: Please enter the commit message for your changes. Lines starting X-Git-Tag: v2.4.21p0371 X-Git-Url: http://git.osdn.net/view?p=eos%2Fbase.git;a=commitdiff_plain;h=24f0a43d1e7974dfe287acf7a6f70e42410e2cf2 Please enter the commit message for your changes. Lines starting with '#' will be ignored, and an empty message aborts the commit. On branch master Your branch is up to date with 'origin/master'. Changes to be committed: modified: bin/wish/Display2/tclIndex modified: hostdepend/ARM64MAC64 modified: src/Objects/DataManip/mrcImage/src/lmrcImageMorphology.c modified: src/Objects/DataManip/mrcImage/src/lmrcImageSoftEdge.c modified: src/Tools/mrcImage/mrcImageSoftEdge/src/test/Makefile Changes not staged for commit: modified: hostdepend/ARM64MAC64 (new commits) modified: include/eosMATH.h --- diff --git a/bin/wish/Display2/tclIndex b/bin/wish/Display2/tclIndex index c4c3f5aa63..ddbd17bdf0 100644 --- a/bin/wish/Display2/tclIndex +++ b/bin/wish/Display2/tclIndex @@ -54,7 +54,6 @@ set auto_index(menuMultiRoiOKCommand) [list source [file join $dir Display2MenuR set auto_index(menuMultiRoiAllDeleteCommand) [list source [file join $dir Display2MenuROI.wish]] set auto_index(menuMultiRoiDeleteCommand) [list source [file join $dir Display2MenuROI.wish]] set auto_index(menuEditCreate) [list source [file join $dir Display2MenuROI.wish]] -set auto_index(fft2dCmd) [list source [file join $dir fft2dCmd.wish]] set auto_index(layerLineRecreate) [list source [file join $dir LayerLineUtil.wish]] set auto_index(layerLineCreate) [list source [file join $dir LayerLineUtil.wish]] set auto_index(layerLineClear) [list source [file join $dir LayerLineUtil.wish]] @@ -137,3 +136,4 @@ set auto_index(sectionClearAll) [list source [file join $dir SectionUtil.wish]] set auto_index(sectionClear) [list source [file join $dir SectionUtil.wish]] set auto_index(sectionChange) [list source [file join $dir SectionUtil.wish]] set auto_index(unitCellRecreate) [list source [file join $dir UnitCell.wish]] +set auto_index(fft2dCmd) [list source [file join $dir fft2dCmd.wish]] diff --git a/hostdepend/ARM64MAC64 b/hostdepend/ARM64MAC64 index 294828f107..b8745dfd26 160000 --- a/hostdepend/ARM64MAC64 +++ b/hostdepend/ARM64MAC64 @@ -1 +1 @@ -Subproject commit 294828f10762d2aee283acb6b34ba86b346b6b25 +Subproject commit b8745dfd26b78656350495ca523e2608ddcb3bfb diff --git a/src/Objects/DataManip/mrcImage/src/lmrcImageMorphology.c b/src/Objects/DataManip/mrcImage/src/lmrcImageMorphology.c index 8b76209d69..6fc2d1a8a2 100644 --- a/src/Objects/DataManip/mrcImage/src/lmrcImageMorphology.c +++ b/src/Objects/DataManip/mrcImage/src/lmrcImageMorphology.c @@ -11,12 +11,15 @@ */ static char __sccs_id[] = "%Z%lmrcImageMorphology ver%I%; Date:%D% %Z%"; +#undef DEBUG +#include "genUtil.h" #include #include "./lmrcImageMorphology.h" void lmrcImageMorphologyStructuringElementSet(lmrcImageMorphologyInfo* linfo, int mode) { + DEBUGPRINT1(" lmrcImageMorphologyStructuringElementSet: %d\n", linfo->mode); switch(linfo->mode) { case 0: { lmrcImageMorphologyStructuringElement2DCross(&linfo->SE, mode); @@ -135,7 +138,7 @@ lmrcImageMorphologyStructuringElementSphere(mrcImage* out, int r, int nx, int ny int rx, ry, rz; double rr, r2; double data; - + DEBUGPRINT("Sphere\n"); mrcDefaultHeaderValueSet(out); out->HeaderN.x = nx; out->HeaderN.y = ny; diff --git a/src/Objects/DataManip/mrcImage/src/lmrcImageSoftEdge.c b/src/Objects/DataManip/mrcImage/src/lmrcImageSoftEdge.c index bd9f39ade0..2f159a7f71 100644 --- a/src/Objects/DataManip/mrcImage/src/lmrcImageSoftEdge.c +++ b/src/Objects/DataManip/mrcImage/src/lmrcImageSoftEdge.c @@ -16,6 +16,7 @@ static char __sccs_id[] = "%Z%lmrcImageSoftEdge ver%I%; Date:%D% %Z%"; #include #include +#include "./lmrcImageMorphology.h" #include "./lmrcImageSoftEdge.h" int @@ -23,13 +24,16 @@ lmrcImageSoftEdge(mrcImage* out, mrcImage* in, lmrcImageSoftEdgeInfo linfo, int { mrcImageParaTypeReal x, y, z; mrcImageParaTypeReal offsetx, offsety, offsetz; - double width; - double data; + double width, tmpWidth; + double data, data0; double distance, near, nearx, neary, nearz; double xmin, ymin, zmin, xmax, ymax, zmax; double max; double dstData; - + mrcImage dilation, tmp; + lmrcImageMorphologyInfo minfo; + int times; + DEBUGPRINT("lmrcImageSoftEdge\n"); out->Header = in->Header; mrcInit(out, NULL); @@ -47,40 +51,75 @@ lmrcImageSoftEdge(mrcImage* out, mrcImage* in, lmrcImageSoftEdgeInfo linfo, int exit(EXIT_FAILURE); break; } +/* + minfo.mode = 5; + minfo.n = width*2+1; + minfo.radius = width; +*/ + minfo.mode = 4; + minfo.n = 3; + lmrcImageMorphologyStructuringElementSet(&minfo, 0); + times = 0; + tmp = *in; + do { + lmrcImageDilation(&dilation, &tmp, minfo, 2); + tmp = dilation; + } while(times<=width); +#ifdef DEBUG + mrcFileWrite(&dilation, "/tmp/test.dilation", "for test", 0); + mrcFileWrite(&minfo.SE, "/tmp/test.se", "for test", 0); +#endif for(z=0; zHeaderN.z; z++) { DEBUGPRINT1("%d\n", (int)z); for(y=0; yHeaderN.y; y++) { for(x=0; xHeaderN.x; x++) { - mrcPixelDataGet(in, x, y, z, &data, mrcPixelRePart, mrcPixelHowNearest); + mrcPixelDataGet(in, x, y, z, &data, mrcPixelRePart, mrcPixelHowNearest); + mrcPixelDataGet(&dilation, x, y, z, &data0, mrcPixelRePart, mrcPixelHowNearest); if(0HeaderN.x - 1); - ymin = MAX(0, y-width); ymax = MIN(y+width, out->HeaderN.y - 1); - zmin = MAX(0, z-width); zmax = MIN(z+width, out->HeaderN.z - 1); - for(offsetz=zmin; offsetz<=zmax; offsetz++) { - for(offsety=ymin; offsety<=ymax; offsety++) { - for(offsetx=xmin; offsetx<=xmax; offsetx++) { - distance = sqrt(SQR(offsetx -x) + SQR(offsety - y) + SQR(offsetz - z)); - if(distanceHeaderN.x - 1); + ymin = MAX(0, y-tmpWidth); ymax = MIN(y+tmpWidth, out->HeaderN.y - 1); + zmin = MAX(0, z-tmpWidth); zmax = MIN(z+tmpWidth, out->HeaderN.z - 1); + for(offsetz=zmin; offsetz<=zmax; offsetz++) { + for(offsety=ymin; offsety<=ymax; offsety++) { + for(offsetx=xmin; offsetx<=xmax; offsetx++) { + distance = sqrt(SQR(offsetx -x) + SQR(offsety - y) + SQR(offsetz - z)); + if(distance