OSDN Git Service

Add a fuction of default environments: Display2Init v2.3.37p0241
authorTakuo Yasunaga <yasunaga@bio.kyutech.ac.jp>
Wed, 16 Mar 2016 03:11:29 +0000 (12:11 +0900)
committerTakuo Yasunaga <yasunaga@bio.kyutech.ac.jp>
Wed, 16 Mar 2016 03:11:29 +0000 (12:11 +0900)
modified:   bin/wish/Display2/Display2Init.wish

Source code fixed for OSX
modified:   src/Tools/mrcImage/mrcImageFourierPowerSpectrum/src/mrcImageFourierPowerSpectrum.c

New functions were added: any directions
modified:   src/Tools/mrcImage/mrcImageMeanFreePathCalc/inc/mrcImageMeanFreePathCalc.h
modified:   src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/argCheck.c
modified:   src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/init.c
modified:   src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/mrcImageMeanFreePathCalc.c
modified:   src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/mrcImageMeanFreePathCalc.html
modified:   src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/mrcImageMeanFreePathCalc.pane
modified:   src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/test/Makefile
modified:   src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/usage.c

15 files changed:
bin/wish/Display2/Display2Init.wish
src/Tools/Config/Define.inc
src/Tools/mrcImage/mrcImageFourierPowerSpectrum/Config/Define.inc
src/Tools/mrcImage/mrcImageFourierPowerSpectrum/Config/OptionControlFile
src/Tools/mrcImage/mrcImageFourierPowerSpectrum/src/mrcImageFourierPowerSpectrum.c
src/Tools/mrcImage/mrcImageFourierPowerSpectrum/src/mrcImageFourierPowerSpectrum.html
src/Tools/mrcImage/mrcImageMeanFreePathCalc/Config/OptionControlFile
src/Tools/mrcImage/mrcImageMeanFreePathCalc/inc/mrcImageMeanFreePathCalc.h
src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/argCheck.c
src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/init.c
src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/mrcImageMeanFreePathCalc.c
src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/mrcImageMeanFreePathCalc.html
src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/mrcImageMeanFreePathCalc.pane
src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/test/Makefile
src/Tools/mrcImage/mrcImageMeanFreePathCalc/src/usage.c

index ed7de69..dc45984 100755 (executable)
@@ -232,6 +232,9 @@ puts $fpt {
 # Default
 #
 
+# font
+option add *font {FixedSys 10}
+
 # Precision
 set tcl_precision 17 
 
index 2b24bf8..557babe 100755 (executable)
@@ -3,3 +3,6 @@ WORLDNAME=Tools
 WORLDNAME=Tools
 WORLDNAME=Tools
 WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
index 62be3fc..3aa223e 100755 (executable)
@@ -1,4 +1,5 @@
 OBJECTNAME = mrcImageFourierPowerSpectrum
-EXTRA_LIB  = -L/usr/cxsoft/lib -lcl -lisamstub
+#EXTRA_LIB  = -L/usr/cxsoft/lib -lcl -lisamstub
+EXTRA_LIB  = 
 EXTRA_CCOPTS =
 EXTRA_INC =
index c2458c2..c9d813f 100755 (executable)
@@ -1,7 +1,7 @@
 # OptionControlFile
 # FileFormat
-"-i","-i[nput]","InputDataFile","Essential","1","1","In","inFile","NULL"
-"-o","-o[utput]","OutputDataFile","Essential","1","1","Out","outFile","NULL"
+"-i","-i[nput]","Input:","Essential","1","1","In","inFile::mrcImage","NULL"
+"-o","-o[utput]","Output:","Optional","1","1","Out","outFile::ASCII","stdout"
 "-dx","-d[elta]x","Minimum width x component","Optional","1","1","dX","Real","1"
 "-dy","-d[elta]y","Minimum width y component","Optional","1","1","dY","Real","0"
 "-dz","-d[elta]z","Minimum width z component","Optional","1","1","dZ","Real","0"
index 8f4dc23..281858f 100755 (executable)
@@ -18,10 +18,9 @@ static char __sccs_id[] = "@(#)mrcImageFourierPowerSpectrum ver1.1; Date:96/07/0
 #include "../inc/config.h"
 #include "mrcImage.h"
 
-void
+int
 main(int argc, char* argv[]) 
 {
-       FILE *fout;
        long status;
        mrcImage src;
        mrcImageFourierPowerSpectrumInfo info;
@@ -35,18 +34,16 @@ main(int argc, char* argv[])
        linfo.dX = info.dX;
        linfo.dY = info.dY;
        linfo.dZ = info.dZ;
-       if((fout = fopen(info.Out, "w")) != NULL)
-       {
-               int i;
-               mrcFileRead(&src, info.In, "in main", 0);
-               theSpectrum = lmrcImageFourierPowerSpectrum(&src, &linfo, 0);
-               for(i = 0; i < theSpectrum.n; i++)
-                       fprintf(fout, "%g\t%g\n", theSpectrum.d * i, theSpectrum.h[i]);
-               lmrcImageFourierPowerSpectrumDeleteSpectrum(theSpectrum);
-               fclose(fout);
-               exit(EXIT_SUCCESS);
+
+       int i;
+       mrcFileRead(&src, info.In, "in main", 0);
+       theSpectrum = lmrcImageFourierPowerSpectrum(&src, &linfo, 0);
+       for(i = 0; i < theSpectrum.n; i++) {
+               fprintf(info.fptOut, "%g\t%g\n", theSpectrum.d * i, theSpectrum.h[i]);
        }
-       else exit(EXIT_FAILURE);
+       lmrcImageFourierPowerSpectrumDeleteSpectrum(theSpectrum);
+
+       return -1;
 }
 
 void
index 7f18f04..7877b1d 100755 (executable)
@@ -1 +1,20 @@
-/bin/bash: mrcImageFourierPowerSpectrum: No such file or directory
+<HTML>
+<HEAD>
+<TITLE>mrcImageFourierPowerSpectrum</TITLE>
+</HEAD>
+<BODY>
+<H1>mrcImageFourierPowerSpectrum</H1>
+<H2>Usage</H2>
+<PRE>
+Usage: mrcImageFourierPowerSpectrum
+Options:
+    [-i[nput]            In                  (NULL      ).as(inFile              ) ] :Essential :InputDataFile
+    [-o[utput]           Out                 (NULL      ).as(outFile             ) ] :Essential :OutputDataFile
+    [-d[elta]x           dX                  (1         ).as(Real                ) ] :Optional  :Minimum width x component
+    [-d[elta]y           dY                  (0         ).as(Real                ) ] :Optional  :Minimum width y component
+    [-d[elta]z           dZ                  (0         ).as(Real                ) ] :Optional  :Minimum width z component
+    [-c[onfig]           configFile          (NULL      ).as(inFile              ) ] :Optional  :ConfigurationFile
+    [-m[ode]             mode                (0         ).as(Integer             ) ] :Optional  :Mode
+</PRE>
+</BODY>
+</HTML>
index d797818..1a43816 100755 (executable)
@@ -6,8 +6,11 @@
 "-Ob","-O[utput]b[lack]","Output: black","Optional","1","1","OutBlack","outFile::mrcImage","NULL"
 "-Owe","-O[utput]w[hite]e[dge]","Output: whiteEdge","Optional","1","1","OutWhiteEdge","outFile::mrcImage","NULL"
 "-Obe","-O[utput]b[lack]e[dge]","Output: blackEdge","Optional","1","1","OutBlackEdge","outFile::mrcImage","NULL"
+"-Odir","-O[utput]dir[ection]","Output: basename.[0|1|2] vector for any","Optional","1","1","Direction","String","direction"
 "-lt","-l[ine]t[hickness]","[pixel]","Optional","2","1","LineThicknessX","Real","1","2","LineThicknessY","Real","1"
 "-lm","-l[ine]m[ode]","LineMode","Optional","1","1","LineMode","Integer","0"
 "-ls","-l[ine]s[hape]","LineShape","Optional","1","1","LineShape","Integer","0"
+"-deltaPhi","-deltaPhi","deltaPhi","Optional","1","1","deltaPhi","Real","30"
+"-deltaTheta","-deltaTheta","deltaTheta","Optional","1","1","deltaTheta","Real","30"
 "-c","-c[onfig]","ConfigurationFile","Optional","1","1","configFile","inFile","NULL"
 "-m","-m[ode]","Mode","Optional","1","1","mode","Integer","0"
index 8c4b07a..29270de 100755 (executable)
@@ -37,6 +37,9 @@ typedef struct mrcImageMeanFreePathCalcInfo {
     char* OutBlackEdge;
     FILE* fptOutBlackEdge;
     
+    long flagDirection;
+    char* Direction;
+    
     long flagLineThicknessX;
     float LineThicknessX;
     
@@ -49,6 +52,12 @@ typedef struct mrcImageMeanFreePathCalcInfo {
     long flagLineShape;
     long LineShape;
     
+    long flagdeltaPhi;
+    float deltaPhi;
+    
+    long flagdeltaTheta;
+    float deltaTheta;
+    
     long flagconfigFile;
     char* configFile;
     FILE* fptconfigFile;
index d8d8b3b..68aef40 100755 (executable)
@@ -94,6 +94,17 @@ argCheck(mrcImageMeanFreePathCalcInfo* info, int argc, char* argv[])
                     }
                     SBREAK;
                 }
+                SCASE("Odir") {
+                    if(i+1<argc) {
+                        info->Direction = stringGetNthWord(argv[i+1], 1, " ,");
+                        i++;
+                        info->flagDirection++;
+                    } else {
+                        usage(argv[0]);
+                        exit(EXIT_FAILURE);
+                    }
+                    SBREAK;
+                }
                 SCASE("lt") {
                     if(i+2<argc) {
                         info->LineThicknessX = stringGetNthRealData(argv[i+1], 1, " ,");
@@ -130,6 +141,28 @@ argCheck(mrcImageMeanFreePathCalcInfo* info, int argc, char* argv[])
                     }
                     SBREAK;
                 }
+                SCASE("deltaPhi") {
+                    if(i+1<argc) {
+                        info->deltaPhi = stringGetNthRealData(argv[i+1], 1, " ,");
+                        i++;
+                        info->flagdeltaPhi++;
+                    } else {
+                        usage(argv[0]);
+                        exit(EXIT_FAILURE);
+                    }
+                    SBREAK;
+                }
+                SCASE("deltaTheta") {
+                    if(i+1<argc) {
+                        info->deltaTheta = stringGetNthRealData(argv[i+1], 1, " ,");
+                        i++;
+                        info->flagdeltaTheta++;
+                    } else {
+                        usage(argv[0]);
+                        exit(EXIT_FAILURE);
+                    }
+                    SBREAK;
+                }
                 SCASE("c") {
                     if(i+1<argc) {
                         info->configFile = stringGetNthWord(argv[i+1], 1, " ,");
index 617c0ff..9bc72aa 100755 (executable)
@@ -18,10 +18,13 @@ init0(mrcImageMeanFreePathCalcInfo* info)
     info->fptOutBlack = NULL;    info->flagOutBlack = 0;
     info->fptOutWhiteEdge = NULL;    info->flagOutWhiteEdge = 0;
     info->fptOutBlackEdge = NULL;    info->flagOutBlackEdge = 0;
+    info->Direction = stringGetNthWord("direction", 1, "\0");    info->flagDirection = 0;
     info->LineThicknessX = 1;    info->flagLineThicknessX = 0;
     info->LineThicknessY = 1;    info->flagLineThicknessY = 0;
     info->LineMode = 0;    info->flagLineMode = 0;
     info->LineShape = 0;    info->flagLineShape = 0;
+    info->deltaPhi = 30;    info->flagdeltaPhi = 0;
+    info->deltaTheta = 30;    info->flagdeltaTheta = 0;
     info->fptconfigFile = NULL;    info->flagconfigFile = 0;
     info->mode = 0;    info->flagmode = 0;
 }
@@ -60,6 +63,9 @@ init1(mrcImageMeanFreePathCalcInfo* info)
         info->fptOutBlackEdge = fileOpen(info->OutBlackEdge, "w");
     }
     
+    if(info->flagDirection) {
+    }
+    
     if(info->flagLineThicknessX) {
     }
     
@@ -72,6 +78,12 @@ init1(mrcImageMeanFreePathCalcInfo* info)
     if(info->flagLineShape) {
     }
     
+    if(info->flagdeltaPhi) {
+    }
+    
+    if(info->flagdeltaTheta) {
+    }
+    
     if(info->flagconfigFile) {
         info->fptconfigFile = fileOpen(info->configFile, "r");
     }
index 7036c21..3d66ff5 100755 (executable)
@@ -53,12 +53,17 @@ typedef struct lmrcImageMeanFreePathCalcInfo {
        mrcImage  black;
        mrcImage  whiteEdge;
        mrcImage  blackEdge;
+       //
+       mrcImage direction[3];
+
 
        // Control: Input
        mrcImageParaTypeRealCoord Length;
        mrcImageParaTypeRealCoord LineThickness;   
        lmrcImageMeanFreePathCalcLineMode  LineMode;
        lmrcImageMeanFreePathCalcLineShape LineShape;
+       mrcImageParaTypeReal deltaPhi;
+       mrcImageParaTypeReal deltaTheta;
 
        // TemporalVariables
        mrcImageParaTypeRealCoord min; 
@@ -70,6 +75,7 @@ typedef enum lmrcImageMeanFreePathCalcMode {
        MeanFreePathCalcModeAlongZaxis=0,
        MeanFreePathCalcModeAlongXaxis=1,
        MeanFreePathCalcModeAlongYaxis=2,
+       MeanFreePathCalcModeAnyDirection=3,
        MeanFreePathCalcModeCalcMode=0x0f,
        MeanFreePathCalcModeRealLength=0x10
 } lmrcImageMeanFreePathCalcMode;
@@ -77,7 +83,9 @@ typedef enum lmrcImageMeanFreePathCalcMode {
 extern void lmrcImageMeanFreePathCalcPrint(FILE* fpt, lmrcImageMeanFreePathCalcInfo* linfo, lmrcImageMeanFreePathCalcMode mode);
 extern void lmrcImageMeanFreePathCalc(mrcImage* in, lmrcImageMeanFreePathCalcInfo* linfo, lmrcImageMeanFreePathCalcMode mode);
 extern void lmrcImageMeanFreePathCalcAlongZaxis(mrcImage* in, lmrcImageMeanFreePathCalcInfo* linfo, lmrcImageMeanFreePathCalcMode  mode);
+extern void lmrcImageMeanFreePathCalcAnyDirection(mrcImage* in, lmrcImageMeanFreePathCalcInfo* linfo, lmrcImageMeanFreePathCalcMode  mode);
 extern double lmrcImageMeanFreePathCalcBWEvaluation(mrcImage* in, lmrcImageMeanFreePathCalcInfo* linfo, lmrcImageMeanFreePathCalcMode  mode);
+extern void lmrcImageMeanFreePathCalcMeanCalc(mrcImage* in, lmrcImageMeanFreePathCalcInfo* linfo, lmrcImageMeanFreePathCalcMode  mode);
 
 extern void lmrcImageMeanFreePathCalcModePrint(FILE* fpt);
 
@@ -87,6 +95,7 @@ main(int argc, char* argv[])
        mrcImageMeanFreePathCalcInfo info;
        lmrcImageMeanFreePathCalcInfo linfo;
        mrcImage in;
+       int i;
 
        init0(&info);
     argCheck(&info, argc, argv);
@@ -104,6 +113,9 @@ main(int argc, char* argv[])
        linfo.LineMode  = info.LineMode;
        linfo.LineShape = info.LineShape;
 
+       linfo.deltaPhi = info.deltaPhi*RADIAN;
+       linfo.deltaTheta = info.deltaTheta*RADIAN;
+
        DEBUGPRINT1("mode: %ld\n", info.mode);
        lmrcImageMeanFreePathCalc(&in, &linfo, info.mode);
 
@@ -121,6 +133,14 @@ main(int argc, char* argv[])
        if(info.flagOutBlackEdge) {
                mrcFileWrite(&linfo.blackEdge, info.OutBlackEdge, "in main", 0);
        }
+
+       if(info.flagDirection && info.mode == 3) {
+               char s[1024];
+               for(i=0; i<3; i++) {
+                       sprintf(s, "%s.%d", info.Direction, i);
+                       mrcFileWrite(&linfo.direction[i], s, "in main", 0);
+               }
+       }
        return EXIT_SUCCESS;
 }
 
@@ -136,9 +156,10 @@ void
 lmrcImageMeanFreePathCalcModePrint(FILE* fpt)
 {
        fprintf(fpt, ">>>> mode \n");
-       fprintf(fpt, "%d: AlongZ-axis\n", MeanFreePathCalcModeAlongZaxis);
-       fprintf(fpt, "%d: AlongX-axis\n", MeanFreePathCalcModeAlongXaxis);
-       fprintf(fpt, "%d: AlongY-axis\n", MeanFreePathCalcModeAlongYaxis);
+       fprintf(fpt, "%d: Along Z-axis\n", MeanFreePathCalcModeAlongZaxis);
+       fprintf(fpt, "%d: Along X-axis\n", MeanFreePathCalcModeAlongXaxis);
+       fprintf(fpt, "%d: Along Y-axis\n", MeanFreePathCalcModeAlongYaxis);
+       fprintf(fpt, "%d: For any direction\n", MeanFreePathCalcModeAnyDirection);
        fprintf(fpt, "+%d: Length is shown in real using HeaderLength \n", MeanFreePathCalcModeRealLength);
 
        fprintf(fpt, ">>>> line shape\n");
@@ -173,6 +194,11 @@ lmrcImageMeanFreePathCalc(mrcImage* in, lmrcImageMeanFreePathCalcInfo* linfo, lm
                        lmrcImageMeanFreePathCalcAlongZaxis(&tmp, linfo, mode);
                        break;
                }
+               case MeanFreePathCalcModeAnyDirection: {
+                       DEBUGPRINT1("mode: %d in Any Direction\n", mode);
+                       lmrcImageMeanFreePathCalcAnyDirection(in, linfo, mode);
+                       break;
+               }
                default: {
                        DEBUGPRINT1("mode: %d in default\n", mode);
                        fprintf(stderr, "Not supported mode: %d\n", mode);
@@ -181,7 +207,6 @@ lmrcImageMeanFreePathCalc(mrcImage* in, lmrcImageMeanFreePathCalcInfo* linfo, lm
                        break;
                }
        }
-
 }
 
 void
@@ -401,6 +426,13 @@ lmrcImageMeanFreePathCalcAlongZaxis(mrcImage* in, lmrcImageMeanFreePathCalcInfo*
                }
        }
        }
+       lmrcImageMeanFreePathCalcMeanCalc(in, linfo, mode);
+}
+
+void
+lmrcImageMeanFreePathCalcMeanCalc(mrcImage* in, lmrcImageMeanFreePathCalcInfo* linfo, lmrcImageMeanFreePathCalcMode  mode)
+{
+       int i;
 
        linfo->averageWhite = linfo->averageBlack = 0; 
        linfo->averageWhiteEdge = linfo->averageBlackEdge = 0; 
@@ -582,3 +614,136 @@ lmrcImageMeanFreePathCalcBWEvaluation(mrcImage* in, lmrcImageMeanFreePathCalcInf
        return data;
 }
 
+
+void 
+lmrcImageMeanFreePathCalcAnyDirection(mrcImage* in, lmrcImageMeanFreePathCalcInfo* linfo, lmrcImageMeanFreePathCalcMode  mode)
+{
+       /*
+       mrcImageParaTypeRealCoord Length;
+       mrcImageParaTypeRealCoord LineThickness;   
+       lmrcImageMeanFreePathCalcLineMode  LineMode;
+       lmrcImageMeanFreePathCalcLineShape LineShape;
+       */
+       
+       mrcImageParaTypeReal x, y, z;
+       mrcImageParaTypeReal dstx, dsty, dstz;
+       mrcImageParaTypeReal phi, theta, dphi, dtheta, dr, r, rmax, rmaxmax, thetamax, phimax;
+       int ntheta, nphi, itheta, iphi, ir, nr;
+       int flagEdge, flagEdgeMax;
+       double data, dstdata;
+       int i, irmaxmax;
+       int* countWhite;
+       int* countBlack;
+       int* countWhiteEdge;
+       int* countBlackEdge;
+
+       linfo->white.Header = in->Header; 
+       linfo->black.Header = in->Header; 
+       linfo->whiteEdge.Header = in->Header; 
+       linfo->blackEdge.Header = in->Header; 
+       mrcInit(&linfo->white, NULL);
+       mrcInit(&linfo->black, NULL);
+       mrcInit(&linfo->whiteEdge, NULL);
+       mrcInit(&linfo->blackEdge, NULL);
+
+       for(i=0; i<3; i++) {
+               linfo->direction[i].Header = in->Header;
+               mrcInit(&linfo->direction[i], NULL);
+       }
+
+       nphi   = floor(2*M_PI/linfo->deltaPhi + 1);
+       if(1<in->HeaderN.z) {
+               ntheta = floor(M_PI/linfo->deltaTheta + 1);
+       } else {
+               ntheta = 1; 
+               theta  = 0;
+       }
+       nr = sqrt(SQR(in->HeaderN.x)+SQR(in->HeaderN.y)+SQR(in->HeaderN.z));
+
+       DEBUGPRINT3("(nr, nphi, ntheta) = (%d %d %d)\n", nr, nphi, ntheta);
+       countBlack     = memoryAllocate(sizeof(int)*(nr+1), "in lmrcImageMeanFreePathCalc");
+       countWhite     = memoryAllocate(sizeof(int)*(nr+1), "in lmrcImageMeanFreePathCalc");
+       countBlackEdge = memoryAllocate(sizeof(int)*(nr+1), "in lmrcImageMeanFreePathCalc");
+       countWhiteEdge = memoryAllocate(sizeof(int)*(nr+1), "in lmrcImageMeanFreePathCalc");
+
+       linfo->countBlack = countBlack;
+       linfo->countWhite = countWhite;
+       linfo->countBlackEdge = countBlackEdge;
+       linfo->countWhiteEdge = countWhiteEdge;
+       linfo->N = nr;
+
+       for(z=0; z<in->HeaderN.z; z++) {
+       for(y=0; y<in->HeaderN.y; y++) {
+       for(x=0; x<in->HeaderN.x; x++) {
+
+               mrcPixelDataGet(in, x, y, z, &data, mrcPixelRePart, mrcPixelHowNearest);
+
+               rmaxmax = 0;
+               for(itheta=0; itheta<ntheta; itheta++) {
+                       if(1<in->HeaderN.z) {
+                               theta = itheta*linfo->deltaTheta - M_PI/2.0; 
+                       } else {
+                               theta = 0;
+                       }
+               for(iphi=0; iphi<nphi; iphi++) {
+                       phi = iphi*linfo->deltaPhi;
+               
+                       flagEdge = 0;
+                       rmax = -1;
+                       for(ir=1; ir<nr; ir++) {
+                               r=ir;
+
+                               dstx = r*cos(phi)*cos(theta)+x; 
+                               dsty = r*sin(phi)*cos(theta)+y; 
+                               dstz = r*sin(theta)         +z; 
+
+                               if(-0.5<=dstx && dstx < in->HeaderN.x -0.5
+                                &&-0.5<=dsty && dsty < in->HeaderN.y -0.5
+                                &&-0.5<=dstz && dstz < in->HeaderN.z -0.5) {
+                                       mrcPixelDataGet(in, dstx, dsty, dstz, &dstdata, mrcPixelRePart, mrcPixelHowNearest);
+                               } else {
+                                       rmax = r - 1;
+                                       flagEdge = 1;
+                                       break;
+                               }
+                               if(dstdata != data) {
+                                       rmax = r - 1;
+                                       break;
+                               }
+                       }
+                       if(rmaxmax<rmax) {
+                               rmaxmax  = rmax;
+                               phimax   = phi;
+                               thetamax = theta;
+                               flagEdgeMax = flagEdge;
+                       }
+               }
+               }
+
+               irmaxmax = (int)rmaxmax;
+               if(0<data) { // white
+                       if(0<flagEdgeMax) { // whiteEdge
+                               mrcPixelDataSet(&linfo->whiteEdge, x, y, z, rmaxmax, mrcPixelRePart);
+                               countWhiteEdge[irmaxmax]++;
+                       } else { // white
+                               mrcPixelDataSet(&linfo->white, x, y, z, rmaxmax, mrcPixelRePart);
+                               countWhite[irmaxmax]++;
+                       }
+               } else {     // black
+                       if(0<flagEdgeMax) { // blackEdge
+                               mrcPixelDataSet(&linfo->blackEdge, x, y, z, rmaxmax, mrcPixelRePart);
+                               countBlackEdge[irmaxmax]++;
+                       } else { // black 
+                               mrcPixelDataSet(&linfo->black, x, y, z, rmaxmax, mrcPixelRePart);
+                               countBlack[irmaxmax]++;
+                       }
+               }
+               mrcPixelDataSet(&linfo->direction[0], x, y, z, cos(phimax)*cos(thetamax), mrcPixelRePart);
+               mrcPixelDataSet(&linfo->direction[1], x, y, z, sin(phimax)*cos(thetamax), mrcPixelRePart);
+               mrcPixelDataSet(&linfo->direction[2], x, y, z,             sin(thetamax), mrcPixelRePart);
+       }
+       }
+       }
+
+       lmrcImageMeanFreePathCalcMeanCalc(in, linfo, mode);
+}
index 25fcbfb..2325f93 100755 (executable)
@@ -14,17 +14,21 @@ Options:
     [-O[utput]b[lack]    OutBlack            (NULL      ).as(outFile::mrcImage   ) ] :Optional  :Output: black
     [-O[utput]w[hite]e[dge]OutWhiteEdge        (NULL      ).as(outFile::mrcImage   ) ] :Optional  :Output: whiteEdge
     [-O[utput]b[lack]e[dge]OutBlackEdge        (NULL      ).as(outFile::mrcImage   ) ] :Optional  :Output: blackEdge
+    [-O[utput]dir[ection]Direction           (direction ).as(String              ) ] :Optional  :Output: basename.[0|1|2] vector for any
     [-l[ine]t[hickness]  LineThicknessX      (1         ).as(Real                ) 
                          LineThicknessY      (1         ).as(Real                ) ] :Optional  :[pixel]
     [-l[ine]m[ode]       LineMode            (0         ).as(Integer             ) ] :Optional  :LineMode
     [-l[ine]s[hape]      LineShape           (0         ).as(Integer             ) ] :Optional  :LineShape
+    [-deltaPhi           deltaPhi            (30        ).as(Real                ) ] :Optional  :deltaPhi
+    [-deltaTheta         deltaTheta          (30        ).as(Real                ) ] :Optional  :deltaTheta
     [-c[onfig]           configFile          (NULL      ).as(inFile              ) ] :Optional  :ConfigurationFile
     [-m[ode]             mode                (0         ).as(Integer             ) ] :Optional  :Mode
 ----- Additional Usage -----
 >>>> mode 
-0: AlongZ-axis
-1: AlongX-axis
-2: AlongY-axis
+0: Along Z-axis
+1: Along X-axis
+2: Along Y-axis
+3: For any direction
 +16: Length is shown in real using HeaderLength 
 >>>> line shape
 0: LineShape-Rectangle
index 796d27e..0e2a41c 100755 (executable)
         -O 1 0 1 0 0 1 -1x1+1+6.000000 ' ' 'OutBlack' 'Output: black' Ob
         -O 1 0 1 0 0 1 -1x1+1+7.500000 ' ' 'OutWhiteEdge' 'Output: whiteEdge' Owe
         -O 1 0 1 0 0 1 -1x1+1+9.000000 ' ' 'OutBlackEdge' 'Output: blackEdge' Obe
-        -I  1 0 0 1 0 1 -1x1+1+10 ' ' '1' 'LineThicknessX' [pixel]
-        -i 1 0 1 0 0 -1x1+1+12.000000 0 0 0 0 0 'LineMode' 'LineMode' lm
-        -i 1 0 1 0 0 -1x1+1+13.500000 0 0 0 0 0 'LineShape' 'LineShape' ls
-        -I 1 0 1 0 0 1 -1x1+1+15.000000 ' ' 'configFile' 'ConfigurationFile' c
-        -i 1 0 1 0 0 -1x1+1+16.500000 0 0 0 0 0 'mode' 'Mode' m
+        -s 1 0 1 0 0 -1x1+1+10.500000 0 0 0 0 0 'Direction' 'Output: basename.[0|1|2] vector for any' Odir
+        -I  1 0 0 1 0 1 -1x1+1+12 ' ' '1' 'LineThicknessX' [pixel]
+        -i 1 0 1 0 0 -1x1+1+13.500000 0 0 0 0 0 'LineMode' 'LineMode' lm
+        -i 1 0 1 0 0 -1x1+1+15.000000 0 0 0 0 0 'LineShape' 'LineShape' ls
+        -f 1 0 1 0 0 -1x1+1+16.500000 0 0 30.000000 0 0 0 'deltaPhi' 'deltaPhi' deltaPhi
+        -f 1 0 1 0 0 -1x1+1+18.000000 0 0 30.000000 0 0 0 'deltaTheta' 'deltaTheta' deltaTheta
+        -I 1 0 1 0 0 1 -1x1+1+19.500000 ' ' 'configFile' 'ConfigurationFile' c
+        -i 1 0 1 0 0 -1x1+1+21.000000 0 0 0 0 0 'mode' 'Mode' m
     -E
   -E
 -E
index 6f835b8..b876a6a 100755 (executable)
@@ -36,6 +36,11 @@ exec4:
        ../$(OSTYPE)/$(OBJECTNAME) -i data/test.bin -o data/test.mfp.x -Ow data/test.white.x -Owe data/test.whiteEdge.x -Ob data/test.black.x -Obe data/test.blackEdge.x -m 1
        ../$(OSTYPE)/$(OBJECTNAME) -i data/test.bin -o data/test.mfp.y -Ow data/test.white.y -Owe data/test.whiteEdge.y -Ob data/test.black.y -Obe data/test.blackEdge.y -m 2
 
+exec5:
+       @echo "----- Execution Check -----"
+       ../$(OSTYPE)/$(OBJECTNAME) -i data/test.bin -o data/test.mfp.any -Ow data/test.white.any -Owe data/test.whiteEdge.any -Ob data/test.black.any -Obe data/test.blackEdge.any -Odir data/test.mode3.dir -m 3 -deltaPhi 10 -deltaTheta 10
+
+
 init:
        pdb2mrc -i data/121p.pdb2 -o data/test.mrc -nx 64 -ny 48 -nz 32 -dx 2 -dy 2 -dz 2 -Sx -64 -Sy -48 -Sz -32 -sig 1.6 -w 1.0
        mrcImageBinalization -i data/test.mrc -o data/test.bin -m 32
index 00ffc66..f50bfe2 100755 (executable)
@@ -13,9 +13,12 @@ usage(char* thisProgram)
     fprintf(stderr, "    [-O[utput]b[lack]    OutBlack            (NULL      ).as(outFile::mrcImage   ) ] :Optional  :Output: black\n");
     fprintf(stderr, "    [-O[utput]w[hite]e[dge]OutWhiteEdge        (NULL      ).as(outFile::mrcImage   ) ] :Optional  :Output: whiteEdge\n");
     fprintf(stderr, "    [-O[utput]b[lack]e[dge]OutBlackEdge        (NULL      ).as(outFile::mrcImage   ) ] :Optional  :Output: blackEdge\n");
+    fprintf(stderr, "    [-O[utput]dir[ection]Direction           (direction ).as(String              ) ] :Optional  :Output: basename.[0|1|2] vector for any\n");
     fprintf(stderr, "    [-l[ine]t[hickness]  LineThicknessX      (1         ).as(Real                ) \n                         LineThicknessY      (1         ).as(Real                ) ] :Optional  :[pixel]\n");
     fprintf(stderr, "    [-l[ine]m[ode]       LineMode            (0         ).as(Integer             ) ] :Optional  :LineMode\n");
     fprintf(stderr, "    [-l[ine]s[hape]      LineShape           (0         ).as(Integer             ) ] :Optional  :LineShape\n");
+    fprintf(stderr, "    [-deltaPhi           deltaPhi            (30        ).as(Real                ) ] :Optional  :deltaPhi\n");
+    fprintf(stderr, "    [-deltaTheta         deltaTheta          (30        ).as(Real                ) ] :Optional  :deltaTheta\n");
     fprintf(stderr, "    [-c[onfig]           configFile          (NULL      ).as(inFile              ) ] :Optional  :ConfigurationFile\n");
     fprintf(stderr, "    [-m[ode]             mode                (0         ).as(Integer             ) ] :Optional  :Mode\n");
     additionalUsage();