Revision | 68c1ec84294f6a9d67f49baa49865fc3c4f1e097 (tree) |
---|---|
Time | 2016-02-20 12:38:56 |
Author | 中野沙紀 <nakanosaki@naka...> |
Commiter | 中野沙紀 |
"create Tool"
@@ -77,6 +77,7 @@ typedef struct lmrcMultiFFTCentralSectionsCompareInfo{ | ||
77 | 77 | int PriorSize; |
78 | 78 | double Variat; |
79 | 79 | double** Sigma; |
80 | + double SigMin; | |
80 | 81 | lmrcMultiFFTCentralSectionsCompareInfoOut* Out; |
81 | 82 | lmrcMultiFFTCentralSectionsCompareInfoOut* Prior; |
82 | 83 | }lmrcMultiFFTCentralSectionsCompareInfo; |
@@ -99,20 +100,28 @@ extern "C" { | ||
99 | 100 | /* prototype begin */ |
100 | 101 | |
101 | 102 | extern void lmrcFFTCentralSectionGet(mrcImage* out, mrcImage* template, mrcImage* volume, lmrcFFTCentralSectionInfo* linfo, int mode); |
103 | + | |
104 | +extern void lmrcImageFFTRhoFilter(mrcImage* volFT, mrcImage* count, lmrcFFTCentralSectionInfo* linfo, int mode); | |
105 | +extern void lmrcImageFFTCentralSectionPut(mrcImage* volFT, mrcImage* count, mrcImage* template3D, mrcImage* in, double probability, lmrcFFTCentralSectionInfo* linfo, int* c, int mode); | |
106 | + | |
107 | +//lmrcFFTCentralSectionCompare.c | |
102 | 108 | extern void lmrcFFTCentralSectionCompare(mrcImage* in, mrcImage* volume, lmrcFFTCentralSectionCompareInfo* linfo, int mode); |
103 | 109 | extern void lmrcFFTCentralSectionCompareInfoWrite(FILE* fpt, float Likelihood, int mode); |
110 | + | |
111 | +//lmrcMultiFFTCentralSectionsComapre | |
104 | 112 | extern void lmrcFFTCentralSectionsGet(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, mrcImage* template, mrcImage* volume, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode, int nummode); |
105 | 113 | extern void lmrcMultiFFTCentralSectionsCompare(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, mrcImage* in, mrcImage* volume, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode, int nummode); |
106 | 114 | extern void lmrcMultiFFTCentralSectionsCompareNormalization(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode); |
107 | 115 | extern void lmrcMultiFFTCentralSectionsCompareInfoWrite(FILE* fpt, char* filename, lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo, float mode1, float mode2); |
108 | 116 | extern void lmrcMultiFFTCentralSectionsCompareInfoSort(lmrcMultiFFTCentralSectionsCompareInfoOut Out[], int left, int right); |
109 | -//extern void lmrcMultiFFTCentralSectionsCompareInfoSortPre(lmrcMultiFFTCentralSectionsCompareInfo* linfo, int left, int right); | |
110 | 117 | extern void lmrcMultiFFTCentralSectionsCompareInfoProbSet(lmrcMultiFFTCentralSectionsCompareInfo* linfo ,int mode); |
111 | 118 | extern void lmrcMultiFFTCentralSectionsCompareInfoLimit(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo, float mode1, float mode2); |
112 | 119 | extern void lmrcMultiFFTCentralSectionsCompareInfoUpdate(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo); |
113 | 120 | extern void lmrcMultiFFTCentralSectionsCompareInfoVariation(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo); |
121 | +extern void lmrcMultiFFTCentralSectionsCompareSigma(mrcImage* in, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode); | |
114 | 122 | /* prototype end */ |
115 | 123 | |
124 | + | |
116 | 125 | #ifdef __cplusplus |
117 | 126 | }; |
118 | 127 | #endif |
@@ -50,7 +50,7 @@ lmrcImageFFTCentralSectionPut(mrcImage* volFT, mrcImage* count, mrcImage* templa | ||
50 | 50 | int i, n, k0; |
51 | 51 | Matrix3D mat; |
52 | 52 | double re3d, im3d; |
53 | - double re3d0=0, im3d0=0; | |
53 | + double re3d0=0, im3d0=0,counter=0; | |
54 | 54 | double re2d, im2d; |
55 | 55 | double re2d0, im2d0; |
56 | 56 | double phaseShift; |
@@ -97,14 +97,13 @@ lmrcImageFFTCentralSectionPut(mrcImage* volFT, mrcImage* count, mrcImage* templa | ||
97 | 97 | |
98 | 98 | mrcPixelDataGet(in, X2d, Y2d, 0, &re2d0, mrcPixelRePart, linfo->InterpMode); |
99 | 99 | mrcPixelDataGet(in, X2d, Y2d, 0, &im2d0, mrcPixelImPart, linfo->InterpMode); |
100 | -//if(re2d0 == 0 && im2d0 == 0){ | |
101 | -//}else{ | |
100 | + if(re2d0 == 0 && im2d0 == 0){ | |
101 | + }else{ | |
102 | 102 | re3d = re2d+re2d0*probability; |
103 | 103 | im3d = im2d+im2d0*probability; |
104 | 104 | |
105 | 105 | re3d0 = re3d*cos(-phaseShift) - im3d*sin(-phaseShift); |
106 | 106 | im3d0 = re3d*sin(-phaseShift) + im3d*cos(-phaseShift); |
107 | - // DEBUGPRINT4("new data: %f %f <- %f %f \n", re2d0, im2d0, re3d0, im3d0); | |
108 | 107 | |
109 | 108 | if((-volFT->HeaderN.x/2)+0.5 < X3d && X3d < (volFT->HeaderN.x/2)-0.5 |
110 | 109 | &&(-volFT->HeaderN.y/2)+0.5 < Y3d && Y3d < (volFT->HeaderN.y/2)-0.5 |
@@ -116,26 +115,22 @@ lmrcImageFFTCentralSectionPut(mrcImage* volFT, mrcImage* count, mrcImage* templa | ||
116 | 115 | if((-volFT->HeaderN.x/2)+0.5 < X3d && X3d < (volFT->HeaderN.x/2)-0.5 |
117 | 116 | &&(-volFT->HeaderN.y/2)+0.5 < Y3d && Y3d < (volFT->HeaderN.y/2)-0.5 |
118 | 117 | &&(-volFT->HeaderN.z/2)+0.5 < Z3d && Z3d < (volFT->HeaderN.z/2)-0.5) { |
119 | - mrcPixelDataGet(count, X3d, Y3d, Z3d, &re3d0, mrcPixelRePart, linfo->InterpMode); | |
120 | - // if(re3d0==0 && im3d0==0){ | |
121 | - // printf("not zerozero\n"); | |
122 | - // }else{ | |
123 | - if(re3d0!=0 || im3d0!=0){ | |
124 | - mrcPixelDataSet(count, X3d, Y3d, Z3d, re3d0+1, mrcPixelRePart); | |
125 | - // printf(" zerozero\n"); | |
126 | - } | |
127 | - // DEBUGPRINT1("count: %f \n", re3d0); | |
118 | + mrcPixelDataGet(count, X3d, Y3d, Z3d, &counter, mrcPixelRePart, linfo->InterpMode); | |
119 | + // if(re3d0!=0 || im3d0!=0){ | |
120 | + // if((re3d - (re2d+re2d0*probability)) != 0){ | |
121 | + mrcPixelDataSet(count, X3d, Y3d, Z3d, counter+1, mrcPixelRePart); | |
122 | + // } | |
128 | 123 | } |
129 | 124 | } |
130 | -// } | |
125 | + } | |
131 | 126 | } |
132 | 127 | |
133 | 128 | lmrcImageFFTCenterChange(volFT, 0); |
134 | -/* | |
129 | + | |
135 | 130 | if(!IsFT(volFT, "lmrcFFTCentralSectionGet", 0)){ |
136 | 131 | mrcImageFree(volFT, 0); |
137 | 132 | memoryFree(volFT); |
138 | - }*/ | |
133 | + } | |
139 | 134 | } |
140 | 135 | |
141 | 136 | void |
@@ -18,7 +18,7 @@ | ||
18 | 18 | |
19 | 19 | #define DEBUG |
20 | 20 | #include "genUtil.h" |
21 | -#include "/Users/nakanosaki/Eos/src/Objects/DataManip/mrcImage/src/lmrcFFTCentralSection.h" | |
21 | +#include "lmrcFFTCentralSection.h" | |
22 | 22 | //#include "Class.h" |
23 | 23 | |
24 | 24 | /* |
@@ -44,7 +44,7 @@ main(int argc, char* argv[]) | ||
44 | 44 | char filename[256], fname[256], EAMode[5]; |
45 | 45 | double rot[3]; |
46 | 46 | char Buf[256]; |
47 | - FILE* fp; | |
47 | + FILE* fpfp; | |
48 | 48 | |
49 | 49 | start = clock(); |
50 | 50 |
@@ -81,7 +81,7 @@ main(int argc, char* argv[]) | ||
81 | 81 | linfo.llinfo.nRot3 = MAX(1,(int)(fabs((linfo.llinfo.Rot3End - linfo.llinfo.Rot3Start)/linfo.llinfo.Rot3Delta)+0.5)); |
82 | 82 | |
83 | 83 | linfo.llinfo.RotSize = ((linfo.llinfo.nRot1))*((linfo.llinfo.nRot2))*((linfo.llinfo.nRot3)); |
84 | - DEBUGPRINT1("RotSize: %d\n",linfo.llinfo.RotSize); | |
84 | + // DEBUGPRINT1("RotSize: %d\n",linfo.llinfo.RotSize); | |
85 | 85 | |
86 | 86 | linfo.OutSize = 0; |
87 | 87 | linfo.PriorSize = 0; |
@@ -152,16 +152,22 @@ main(int argc, char* argv[]) | ||
152 | 152 | lmrcMultiFFTCentralSectionsCompareInfoSort(linfo.Out, 0, linfo.OutSize-1); |
153 | 153 | lmrcMultiFFTCentralSectionsCompareInfoLimit(linfo.Out, &linfo, info.Lmode1, info.Lmode2); |
154 | 154 | lmrcMultiFFTCentralSectionsCompareNormalization(linfo.Out, &linfo, info.Lcalcmode); |
155 | - lmrcMultiFFTCentralSectionsCompareInfoWrite(info.fptOut1, info.In2D, linfo.Out, &linfo, info.Lmode1, info.Lmode2); | |
155 | + if((fpfp=fopen(info.Out1,"a"))==NULL){ | |
156 | + printf("Out file open error\n"); | |
157 | + exit(EXIT_FAILURE); | |
158 | + } | |
159 | + lmrcMultiFFTCentralSectionsCompareInfoWrite(fpfp, info.In2D, linfo.Out, &linfo, info.Lmode1, info.Lmode2); | |
160 | + //lmrcMultiFFTCentralSectionsCompareInfoWrite(info.fptOut1, info.In2D, linfo.Out, &linfo, info.Lmode1, info.Lmode2); | |
156 | 161 | lmrcMultiFFTCentralSectionsCompareInfoVariation(linfo.Out, &linfo); |
157 | 162 | // lmrcMultiFFTCentralSectionsCompareInfoProbSet(linfo.Out, &linfo ,1); |
158 | 163 | |
159 | 164 | DEBUGPRINT1("Prior: %f\n",linfo.Out[0].Prob); |
160 | - | |
165 | +/* | |
161 | 166 | for(i=0; i< linfo.PriorSize; i++){ |
162 | 167 | if(linfo.Out[i].Prob >0.0){ |
163 | 168 | DEBUGPRINT1(" %15.6e \n", linfo.Out[i].Prob); |
164 | 169 | }} |
170 | + */ | |
165 | 171 | free(linfo.Out); |
166 | 172 | free(linfo.Prior); |
167 | 173 |