This repository is a base of Eos.
Revisión | 57e35b6bda749e1819221aa08ea51271efd10116 (tree) |
---|---|
Tiempo | 2016-05-16 15:47:47 |
Autor | 久永浩司 <hisanagakouji@hisa...> |
Commiter | 久永浩司 |
change function of ctfDeterminationByBayes
@@ -43,11 +43,15 @@ extern "C" { | ||
43 | 43 | |
44 | 44 | extern void ctfforbayesInit(FILE* fpt, ctfforbayes* ctf, int mode); |
45 | 45 | extern void spatialfrequencyRead(FILE* fpt, ctfforbayes* ctf, int mode); |
46 | -extern void IntensityRead(char* filename, ctfforbayes* ctf,int mode, FILE* fpt); | |
47 | -extern void ctfFunctionforbayes(ctfforbayes* ctf, eosBayesDistribution* d, ctfInfo* info, int numLikelihood, int mode, FILE* fpt); | |
46 | +extern void IntensityRead(char* filename, ctfforbayes* ctf,int mode); | |
47 | +extern void ctfFunctionforbayes(ctfforbayes* ctf, eosBayesDistribution* d, ctfInfo* info, int numLikelihood, int count, int mode); | |
48 | +extern float MTFFunctionforbayes(float R, float m, int mode); | |
48 | 49 | |
49 | -extern void defocuslikelihood(ctfforbayes ctf, eosBayes* d, int mode); | |
50 | -extern void defocuslikelihoodcaluculation(ctfforbayes ctf, eosBayesDistribution* d, int numLikelihood, int mode, FILE* fpt, FILE* fpt2); | |
50 | + | |
51 | +extern void defocuslikelihood(ctfforbayes ctf, eosBayes* d, int count, int mode); | |
52 | +extern void defocuslikelihoodcaluculationLorentz(ctfforbayes ctf, eosBayesDistribution* d, int numLikelihood, int count, int mode); | |
53 | + | |
54 | +extern void ctfforbayescheckRvsValue(char* filename, float R,float value, int count); | |
51 | 55 | |
52 | 56 | /* prototype end */ |
53 | 57 |
@@ -25,7 +25,7 @@ typedef struct eosBayes { | ||
25 | 25 | typedef enum eosBayesDistributionInfoMode { |
26 | 26 | eosBayesDistributionInfoModeGaussian=0 |
27 | 27 | |
28 | -} eosBayesDistributionInfoMode; | |
28 | +} eosBayesDistributionInfoMode; | |
29 | 29 | |
30 | 30 | typedef struct eosBayesDistributionInfo { |
31 | 31 | float min; |
@@ -39,12 +39,13 @@ typedef struct eosBayesDistributionInfo { | ||
39 | 39 | // For Gaussian |
40 | 40 | float mean; |
41 | 41 | float sigma; |
42 | + | |
42 | 43 | } eosBayesDistributionInfo; |
43 | 44 | |
44 | 45 | |
45 | 46 | /* eosBayesInit.c */ |
46 | 47 | // Initialization of eosBays |
47 | -extern void leosBayesInit(eosBayes* b, int numDistribution, int numLikelihood, int mode); | |
48 | +extern void leosBayesInit(eosBayes* d, int numDistribution, int numLikelihood, int mode); | |
48 | 49 | |
49 | 50 | extern void eosBayesCondition(FILE* fptIn, eosBayes* d, eosBayesDistributionInfo* llinfo, int mode); |
50 | 51 |
@@ -55,9 +56,9 @@ extern void eosBayesDistributionInit(eosBayesDistribution* d,eosBayesDistributio | ||
55 | 56 | extern void eosBayesDistributionInitialProbabilitySet(eosBayesDistribution* d, eosBayesDistributionInfo* info, int mode); |
56 | 57 | |
57 | 58 | /* eosBayesEstimation.c */ |
58 | -extern void eosBayesEstimation(eosBayes* d, int mode, FILE* fpt); | |
59 | +extern void eosBayesEstimation(eosBayes* d, int mode); | |
59 | 60 | extern void eosBayesPosteriortoPrior(eosBayes* d, int mode); |
60 | - | |
61 | +extern void eosBayesloop(eosBayesDistribution* d, int* L, int numDist, int length); | |
61 | 62 | |
62 | 63 | /* eosBayesWrite.c */ |
63 | 64 | extern void eosBayesDistribututionWrite(FILE* fpt, eosBayesDistribution* d, int mode); |
@@ -70,6 +71,7 @@ extern void eosBayesWrite(FILE* fpt, eosBayes* d, int mode); | ||
70 | 71 | // 1 min1 max1 delta1 n1 out.prior[1].prob[0] ...... prob[n-1] |
71 | 72 | |
72 | 73 | extern void DistributionChangeCheck(eosBayes* d, int mode); |
74 | +extern void LikelihoodChangeCheck(eosBayes* d, int count, int mode); | |
73 | 75 | //FileFoemat |
74 | 76 | //min max delta n |
75 | 77 | //value prob |
@@ -15,6 +15,7 @@ static char __sccs_id[] = "%Z%ctfforbayes ver%I%; Date:%D% %Z%"; | ||
15 | 15 | #include <stdio.h> |
16 | 16 | #include <string.h> |
17 | 17 | #include <stdlib.h> |
18 | +#include <math.h> | |
18 | 19 | #include "eosBayes.h" |
19 | 20 | #include "../inc/ctfInfo.h" |
20 | 21 | #include "./ctffuncforbayes.h" |
@@ -23,6 +24,7 @@ static char __sccs_id[] = "%Z%ctfforbayes ver%I%; Date:%D% %Z%"; | ||
23 | 24 | |
24 | 25 | |
25 | 26 | #define DEBUG |
27 | +#undef DEBUG2 | |
26 | 28 | #include "genUtil.h" |
27 | 29 | #include "String.h" |
28 | 30 |
@@ -65,7 +67,7 @@ void spatialfrequencyRead(FILE* fpt, ctfforbayes* ctf, int mode){ | ||
65 | 67 | |
66 | 68 | |
67 | 69 | |
68 | -void IntensityRead(char* filename, ctfforbayes* ctf, int mode, FILE* fpt){ | |
70 | +void IntensityRead(char* filename, ctfforbayes* ctf, int mode){ | |
69 | 71 | FILE* fin; |
70 | 72 | int i; |
71 | 73 | char s[1024]; |
@@ -80,12 +82,10 @@ void IntensityRead(char* filename, ctfforbayes* ctf, int mode, FILE* fpt){ | ||
80 | 82 | i=0; |
81 | 83 | while(NULL != __getStringData(s,"In IntensityRead",fin,stdout,3)){ |
82 | 84 | ctf->I[i] = atof(s); |
83 | - fprintf(fpt,"%f %f\n",ctf->R[i],ctf->I[i]); | |
84 | 85 | i++; |
85 | 86 | } |
86 | 87 | |
87 | 88 | fclose(fin); |
88 | - fclose(fpt); | |
89 | 89 | |
90 | 90 | DEBUGPRINT("file closed\n"); |
91 | 91 |
@@ -94,69 +94,100 @@ void IntensityRead(char* filename, ctfforbayes* ctf, int mode, FILE* fpt){ | ||
94 | 94 | |
95 | 95 | |
96 | 96 | |
97 | -void ctfFunctionforbayes(ctfforbayes* ctf, eosBayesDistribution* d, ctfInfo* info, int numLikelihood, int mode, FILE* fpt){ | |
97 | +void ctfFunctionforbayes(ctfforbayes* ctf, eosBayesDistribution* d, ctfInfo* info, int numLikelihood, int count, int mode){ | |
98 | 98 | |
99 | - | |
100 | - float A; | |
101 | - float B; | |
99 | + float S; | |
100 | + float N; | |
101 | + float k; | |
102 | 102 | float CTF; |
103 | + float MTF; | |
103 | 104 | |
104 | 105 | int length; |
105 | 106 | |
106 | 107 | int i; |
107 | 108 | int j; |
108 | - int k; | |
109 | 109 | |
110 | 110 | int* L; |
111 | - int N1; | |
112 | - int N2; | |
113 | 111 | |
114 | - DEBUGPRINT("in ctf\n"); | |
112 | + DEBUGPRINT("In ctf\n"); | |
115 | 113 | |
116 | 114 | length = 1; |
117 | - | |
118 | 115 | for(i=0;i<numLikelihood;i++){ |
119 | - length *= d[i].n; | |
116 | + length *= d[i].n; | |
120 | 117 | } |
121 | - | |
118 | + | |
122 | 119 | DEBUGPRINT("L malloc\n"); |
123 | - | |
120 | + | |
124 | 121 | L = (int *)malloc(sizeof(int)*numLikelihood); |
125 | - | |
122 | + | |
126 | 123 | DEBUGPRINT("L malloc\n"); |
127 | - | |
124 | + | |
128 | 125 | for(i=0;i<ctf->n;i++){ |
126 | + | |
127 | + ctf->Ii[i] = (float *)malloc(sizeof(float)*length); | |
128 | + //DEBUGPRINT("Ii malloc\n"); | |
129 | + | |
130 | + for(j=0;j<length;j++){ | |
131 | + | |
132 | + eosBayesloop(d,L,numLikelihood,j); | |
133 | + | |
134 | + //DEBUGPRINT3("%d:%d:%d\n",L[0],L[1],L[2]); | |
135 | + | |
136 | + info->defocus = d[0].min+(d[0].delta*L[0]); | |
137 | + S = d[1].min+(d[1].delta*L[1]); | |
138 | + N = d[2].min+(d[2].delta*L[2]); | |
139 | + CTF = ctfFunction(info, ctf->R[i], 0); | |
140 | + | |
141 | + /*value check*/ | |
142 | +#ifdef DEBUG2 | |
143 | + ctfforbayescheckRvsValue("./data/CTF", ctf->R[i], CTF, count); | |
144 | +#endif | |
145 | + | |
146 | + MTF = MTFFunctionforbayes(ctf->R[i], 0, 0); | |
147 | + //DEBUGPRINT1("MTF:%f\n",MTF); | |
148 | + | |
149 | + switch(mode){ | |
150 | + | |
151 | + case 0: | |
152 | + ctf->Ii[i][j] = (CTF*CTF*S+N)*MTF; | |
153 | + break; | |
154 | + | |
155 | + case 1: | |
156 | + k = d[3].min+(d[3].delta*L[3]); | |
157 | + ctf->Ii[i][j] = (CTF*CTF*S*exp(-(k*k)*(ctf->R[i]*ctf->R[i]))+N)*MTF; | |
158 | + break; | |
159 | + | |
160 | + default: | |
161 | + fprintf(stderr,"\n"); | |
162 | + break; | |
129 | 163 | |
130 | - ctf->Ii[i] = (float *)malloc(sizeof(float)*length); | |
131 | -// DEBUGPRINT("Ii malloc\n"); | |
132 | - | |
133 | - for(j=0;j<length;j++){ | |
134 | - N1=1; | |
135 | - N2=1; | |
136 | - for(k=0;k<numLikelihood-1;k++){ | |
137 | - N2 = d[k].n; | |
138 | - L[k] = (j/N1)%N2; | |
139 | - N1 *= d[k].n; | |
140 | - } | |
141 | - L[numLikelihood-1] = j/N1; | |
142 | - | |
143 | -// DEBUGPRINT3("%d:%d:%d\n",L[0],L[1],L[2]); | |
144 | - | |
145 | - info->defocus = d[0].min+(d[0].delta*L[0]); | |
146 | - A = d[1].min+(d[1].delta*L[1]); | |
147 | - B = d[2].min+(d[2].delta*L[2]); | |
148 | - CTF = ctfFunction(info,ctf->R[i], 0); | |
149 | - ctf->Ii[i][j] = CTF*CTF*A+B; | |
150 | 164 | } |
151 | - fprintf(fpt,"#%f\n",info->defocus); | |
152 | - fprintf(fpt,"%f %f\n",ctf->R[i],CTF); | |
153 | - | |
154 | 165 | |
166 | + } | |
167 | + | |
155 | 168 | } |
156 | - | |
157 | - fclose(fpt); | |
169 | + | |
158 | 170 | free(L); |
159 | - | |
171 | + | |
160 | 172 | } |
161 | 173 | |
162 | 174 | |
175 | +float MTFFunctionforbayes(float R, float m, int mode){ | |
176 | + | |
177 | + float MTF; | |
178 | + | |
179 | + switch(mode){ | |
180 | + | |
181 | + case 0: | |
182 | + MTF = exp(-(m*R)); | |
183 | + break; | |
184 | + | |
185 | + default: | |
186 | + fprintf(stderr,""); | |
187 | + break; | |
188 | + | |
189 | + } | |
190 | + | |
191 | + return MTF; | |
192 | + | |
193 | +} |
@@ -0,0 +1,44 @@ | ||
1 | +/* | |
2 | +# %M% %Y% %I% | |
3 | +# The latest update : %G% at %U% | |
4 | +# | |
5 | +#%Z% ctfforbayescheck ver %I% | |
6 | +#%Z% Created by | |
7 | +#%Z% | |
8 | +#%Z% Usage : ctfforbayescheck | |
9 | +#%Z% Attention | |
10 | +#%Z% | |
11 | +*/ | |
12 | +static char __sccs_id[] = "%Z%ctfforbayescheck ver%I%; Date:%D% %Z%"; | |
13 | + | |
14 | + | |
15 | +#include <stdio.h> | |
16 | +#include <string.h> | |
17 | +#include <stdlib.h> | |
18 | +#include "eosBayes.h" | |
19 | +#include "../inc/ctfInfo.h" | |
20 | +#include "./ctffuncforbayes.h" | |
21 | + | |
22 | +#define DEBUG | |
23 | +#include "genUtil.h" | |
24 | +#include "String.h" | |
25 | + | |
26 | + | |
27 | + | |
28 | +void ctfforbayescheckRvsValue(char* filename, float R,float value, int count){ | |
29 | + | |
30 | + FILE* fpt; | |
31 | + char s[1024]; | |
32 | + | |
33 | + sprintf(s,"%s%d.out",filename,count); | |
34 | + | |
35 | + if((fpt=fopen(s,"a"))==NULL){ | |
36 | + fprintf(stderr,"fopen error: %s\n",s); | |
37 | + exit(1); | |
38 | + } | |
39 | + | |
40 | + fprintf(fpt,"%f %f\n",R,value); | |
41 | + | |
42 | + fclose(fpt); | |
43 | + | |
44 | +} |
@@ -0,0 +1,44 @@ | ||
1 | +/* | |
2 | +# %M% %Y% %I% | |
3 | +# The latest update : %G% at %U% | |
4 | +# | |
5 | +#%Z% ctfforbayescheck ver %I% | |
6 | +#%Z% Created by | |
7 | +#%Z% | |
8 | +#%Z% Usage : ctfforbayescheck | |
9 | +#%Z% Attention | |
10 | +#%Z% | |
11 | +*/ | |
12 | +static char __sccs_id[] = "%Z%ctfforbayescheck ver%I%; Date:%D% %Z%"; | |
13 | + | |
14 | + | |
15 | +#include <stdio.h> | |
16 | +#include <string.h> | |
17 | +#include <stdlib.h> | |
18 | +#include "eosBayes.h" | |
19 | +#include "../inc/ctfInfo.h" | |
20 | +include "./ctffuncforbayes.h" | |
21 | + | |
22 | +#define DEBUG | |
23 | +#include "genUtil.h" | |
24 | +#include "String.h" | |
25 | + | |
26 | + | |
27 | + | |
28 | +void ctffobayescheckRvsValue(char* filename, float R,float value, int count){ | |
29 | + | |
30 | + FILE* fpt; | |
31 | + char s[1024]; | |
32 | + | |
33 | + sprintf(s,"%s%d.out",filename,count); | |
34 | + | |
35 | + if((fpt=fopen(s,"a"))==NULL){ | |
36 | + fprintf(stderr,"fopen error: %s\n",s); | |
37 | + exit(1); | |
38 | + } | |
39 | + | |
40 | + fprintf(fpt,"%f %f\n",R,value); | |
41 | + | |
42 | + fclose(fpt); | |
43 | + | |
44 | +} |
@@ -28,6 +28,12 @@ typedef struct ctfforbayes{ | ||
28 | 28 | float** Ii; |
29 | 29 | } ctfforbayes; |
30 | 30 | |
31 | +typedef struct intencityforbayes{ | |
32 | + | |
33 | + | |
34 | + | |
35 | +}intencityforbayes; | |
36 | + | |
31 | 37 | /* struct end */ |
32 | 38 | |
33 | 39 | #ifdef __cplusplus |
@@ -43,11 +49,15 @@ extern "C" { | ||
43 | 49 | |
44 | 50 | extern void ctfforbayesInit(FILE* fpt, ctfforbayes* ctf, int mode); |
45 | 51 | extern void spatialfrequencyRead(FILE* fpt, ctfforbayes* ctf, int mode); |
46 | -extern void IntensityRead(char* filename, ctfforbayes* ctf,int mode, FILE* fpt); | |
47 | -extern void ctfFunctionforbayes(ctfforbayes* ctf, eosBayesDistribution* d, ctfInfo* info, int numLikelihood, int mode, FILE* fpt); | |
52 | +extern void IntensityRead(char* filename, ctfforbayes* ctf,int mode); | |
53 | +extern void ctfFunctionforbayes(ctfforbayes* ctf, eosBayesDistribution* d, ctfInfo* info, int numLikelihood, int count, int mode); | |
54 | +extern float MTFFunctionforbayes(float R, float m, int mode); | |
55 | + | |
56 | + | |
57 | +extern void defocuslikelihood(ctfforbayes ctf, eosBayes* d, int count, int mode); | |
58 | +extern void defocuslikelihoodcaluculationLorentz(ctfforbayes ctf, eosBayesDistribution* d, int numLikelihood, int count, int mode); | |
48 | 59 | |
49 | -extern void defocuslikelihood(ctfforbayes ctf, eosBayes* d, int mode); | |
50 | -extern void defocuslikelihoodcaluculation(ctfforbayes ctf, eosBayesDistribution* d, int numLikelihood, int mode, FILE* fpt, FILE* fpt2); | |
60 | +extern void ctfforbayescheckRvsValue(char* filename, float R,float value, int count); | |
51 | 61 | |
52 | 62 | /* prototype end */ |
53 | 63 |
@@ -15,11 +15,13 @@ static char __sccs_id[] = "%Z%defocuslikelihood ver%I%; Date:%D% %Z%"; | ||
15 | 15 | #include <stdio.h> |
16 | 16 | #include <string.h> |
17 | 17 | #include <stdlib.h> |
18 | +#include <math.h> | |
18 | 19 | #include "eosBayes.h" |
19 | 20 | #include "../inc/ctfInfo.h" |
20 | 21 | #include "./ctffuncforbayes.h" |
21 | 22 | |
22 | 23 | #define DEBUG |
24 | +#undef DEBUG2 | |
23 | 25 | #include "genUtil.h" |
24 | 26 | #include "String.h" |
25 | 27 |
@@ -27,10 +29,23 @@ static char __sccs_id[] = "%Z%defocuslikelihood ver%I%; Date:%D% %Z%"; | ||
27 | 29 | |
28 | 30 | |
29 | 31 | |
30 | -void defocuslikelihood(ctfforbayes ctf, eosBayes* d, int mode){ | |
32 | +void defocuslikelihood(ctfforbayes ctf, eosBayes* d, int count, int mode){ | |
33 | + | |
34 | + switch(mode){ | |
35 | + | |
36 | + case 0: | |
37 | + defocuslikelihoodcaluculationLorentz(ctf, d->likelihood, d->numLikelihood, count, 0); | |
38 | + break; | |
39 | + | |
40 | + default: | |
41 | + fprintf(stderr,""); | |
42 | + break; | |
43 | + | |
44 | + } | |
45 | + | |
31 | 46 | } |
32 | 47 | |
33 | -void defocuslikelihoodcaluculation(ctfforbayes ctf, eosBayesDistribution* d, int numLikelihood, int mode, FILE* fpt, FILE* fpt2){ | |
48 | +void defocuslikelihoodcaluculationLorentz(ctfforbayes ctf, eosBayesDistribution* d, int numLikelihood, int count, int mode){ | |
34 | 49 | float difference; |
35 | 50 | float* sum; |
36 | 51 |
@@ -39,14 +54,11 @@ void defocuslikelihoodcaluculation(ctfforbayes ctf, eosBayesDistribution* d, int | ||
39 | 54 | int i; |
40 | 55 | int j; |
41 | 56 | int k; |
42 | - int l; | |
43 | 57 | |
44 | 58 | int* L; |
45 | - int N1; | |
46 | - int N2; | |
47 | 59 | |
48 | 60 | DEBUGPRINT("In defocuslikelihood\n"); |
49 | - | |
61 | + | |
50 | 62 | length = 1; |
51 | 63 | for(i=0;i<numLikelihood;i++){ |
52 | 64 | length *= d[i].n; |
@@ -74,56 +86,55 @@ void defocuslikelihoodcaluculation(ctfforbayes ctf, eosBayesDistribution* d, int | ||
74 | 86 | |
75 | 87 | |
76 | 88 | for(j=0;j<length;j++){ |
77 | - N1=1; | |
78 | - N2=1; | |
79 | - for(k=0;k<numLikelihood-1;k++){ | |
80 | - N2 = d[k].n; | |
81 | - L[k] = (j/N1)%N2; | |
82 | - N1 *= d[k].n; | |
83 | - } | |
84 | - L[numLikelihood-1] = j/N1; | |
89 | + | |
90 | + eosBayesloop(d,L,numLikelihood,j); | |
85 | 91 | |
86 | 92 | |
87 | - difference = 0; | |
88 | - for(l=45;l<101;l++){ | |
89 | - fprintf(fpt2,"%f %f %f\n",ctf.R[l],ctf.I[l],ctf.Ii[l][L[0]]); | |
90 | - difference += (ctf.I[l]-ctf.Ii[l][j])*(ctf.I[l]-ctf.Ii[l][j]); | |
91 | - } | |
93 | + difference = 0; | |
94 | + for(k=100;k<201;k++){ | |
95 | + difference += (ctf.I[k]-ctf.Ii[k][j])*(ctf.I[k]-ctf.Ii[k][j]); | |
92 | 96 | |
93 | - DEBUGPRINT3("L[0]:%d L[1]:%d L[2]:%d\n",L[0],L[1],L[2]); | |
97 | + /*check value*/ | |
98 | +#ifdef DEBUG2 | |
99 | + ctfforbayescheckRvsValue("./data/diffdef",ctf.R[k],(ctf.I[k]-ctf.Ii[k][L[0]])*(ctf.I[k]-ctf.Ii[k][L[0]]),count); | |
100 | + ctfforbayescheckRvsValue("./data/diffA",ctf.R[k],(ctf.I[k]-ctf.Ii[k][L[1]])*(ctf.I[k]-ctf.Ii[k][L[1]]),count); | |
101 | + ctfforbayescheckRvsValue("./data/diffB",ctf.R[k],(ctf.I[k]-ctf.Ii[k][L[2]])*(ctf.I[k]-ctf.Ii[k][L[2]]),count); | |
102 | +#endif | |
94 | 103 | |
95 | - d[0].prob[L[0]] += 1/(1e-6 + difference); | |
96 | - d[1].prob[L[1]] += 1/(1e-6 + difference); | |
97 | - d[2].prob[L[2]] += 1/(1e-6 + difference); | |
98 | - } | |
104 | + } | |
99 | 105 | |
100 | 106 | |
107 | + //DEBUGPRINT3("L[0]:%d L[1]:%d L[2]:%d\n",L[0],L[1],L[2]); | |
108 | + for(k=0;k<numLikelihood;k++){ | |
109 | + d[k].prob[L[k]] += 1/(1e-6 + difference); | |
110 | + } | |
101 | 111 | |
102 | - DEBUGPRINT("likelihood culcu\n"); | |
112 | + } | |
103 | 113 | |
114 | + | |
115 | + | |
116 | + DEBUGPRINT("likelihood culcu\n"); | |
117 | + | |
118 | + /*normalization*/ | |
104 | 119 | for(i=0;i<numLikelihood;i++){ |
105 | - for(j=0;j<d[i].n;j++){ | |
106 | - sum[i] += d[i].prob[j]; | |
107 | - } | |
120 | + for(j=0;j<d[i].n;j++){ | |
121 | + sum[i] += d[i].prob[j]; | |
122 | + } | |
108 | 123 | } |
124 | + | |
109 | 125 | |
110 | - | |
111 | - | |
126 | + | |
112 | 127 | for(i=0;i<numLikelihood;i++){ |
113 | - DEBUGPRINT2("%dlikelihood.n:%d\n",i,d[i].n); | |
114 | - for(j=0;j<d[i].n;j++){ | |
115 | - d[i].prob[j] /= sum[i]; | |
116 | - DEBUGPRINT2("likelihood%d:%f\n",i,d[i].prob[j]); | |
117 | - fprintf(fpt,"%f\n",d[i].prob[j]); | |
118 | - } | |
128 | + DEBUGPRINT2("%dlikelihood.n:%d\n",i,d[i].n); | |
129 | + for(j=0;j<d[i].n;j++){ | |
130 | + d[i].prob[j] /= sum[i]; | |
131 | + DEBUGPRINT2("likelihood%d:%f\n",i,d[i].prob[j]); | |
132 | + } | |
119 | 133 | } |
120 | - | |
134 | + | |
121 | 135 | DEBUGPRINT("free\n"); |
122 | - | |
136 | + | |
123 | 137 | free(L); |
124 | 138 | free(sum); |
125 | - fclose(fpt); | |
126 | - fclose(fpt2); | |
127 | - | |
128 | - | |
139 | + | |
129 | 140 | } |
@@ -25,7 +25,7 @@ typedef struct eosBayes { | ||
25 | 25 | typedef enum eosBayesDistributionInfoMode { |
26 | 26 | eosBayesDistributionInfoModeGaussian=0 |
27 | 27 | |
28 | -} eosBayesDistributionInfoMode; | |
28 | +} eosBayesDistributionInfoMode; | |
29 | 29 | |
30 | 30 | typedef struct eosBayesDistributionInfo { |
31 | 31 | float min; |
@@ -39,12 +39,13 @@ typedef struct eosBayesDistributionInfo { | ||
39 | 39 | // For Gaussian |
40 | 40 | float mean; |
41 | 41 | float sigma; |
42 | + | |
42 | 43 | } eosBayesDistributionInfo; |
43 | 44 | |
44 | 45 | |
45 | 46 | /* eosBayesInit.c */ |
46 | 47 | // Initialization of eosBays |
47 | -extern void leosBayesInit(eosBayes* b, int numDistribution, int numLikelihood, int mode); | |
48 | +extern void leosBayesInit(eosBayes* d, int numDistribution, int numLikelihood, int mode); | |
48 | 49 | |
49 | 50 | extern void eosBayesCondition(FILE* fptIn, eosBayes* d, eosBayesDistributionInfo* llinfo, int mode); |
50 | 51 |
@@ -55,9 +56,9 @@ extern void eosBayesDistributionInit(eosBayesDistribution* d,eosBayesDistributio | ||
55 | 56 | extern void eosBayesDistributionInitialProbabilitySet(eosBayesDistribution* d, eosBayesDistributionInfo* info, int mode); |
56 | 57 | |
57 | 58 | /* eosBayesEstimation.c */ |
58 | -extern void eosBayesEstimation(eosBayes* d, int mode, FILE* fpt); | |
59 | +extern void eosBayesEstimation(eosBayes* d, int mode); | |
59 | 60 | extern void eosBayesPosteriortoPrior(eosBayes* d, int mode); |
60 | - | |
61 | +extern void eosBayesloop(eosBayesDistribution* d, int* L, int numDist, int length); | |
61 | 62 | |
62 | 63 | /* eosBayesWrite.c */ |
63 | 64 | extern void eosBayesDistribututionWrite(FILE* fpt, eosBayesDistribution* d, int mode); |
@@ -70,6 +71,7 @@ extern void eosBayesWrite(FILE* fpt, eosBayes* d, int mode); | ||
70 | 71 | // 1 min1 max1 delta1 n1 out.prior[1].prob[0] ...... prob[n-1] |
71 | 72 | |
72 | 73 | extern void DistributionChangeCheck(eosBayes* d, int mode); |
74 | +extern void LikelihoodChangeCheck(eosBayes* d, int count, int mode); | |
73 | 75 | //FileFoemat |
74 | 76 | //min max delta n |
75 | 77 | //value prob |
@@ -42,7 +42,7 @@ void eosBayesCondition(FILE* fptIn, eosBayes* d, eosBayesDistributionInfo* llinf | ||
42 | 42 | llinfo->sigma = stringGetNthRealData(s, 7," \t"); |
43 | 43 | |
44 | 44 | DEBUGPRINT1("%s\n",s); |
45 | - DEBUGPRINT6("%f %f %f %u %f %f\n",llinfo->min,llinfo->max,llinfo->delta,llinfo->mode,llinfo->mean,llinfo->sigma); | |
45 | + DEBUGPRINT6("min:%f max:%f delta:%f mode:%u mean:%f sigma:%f\n",llinfo->min,llinfo->max,llinfo->delta,llinfo->mode,llinfo->mean,llinfo->sigma); | |
46 | 46 | eosBayesDistributionInit(&(d->prior[i]),llinfo,0); |
47 | 47 | eosBayesDistributionInit(&(d->posterior[i]),llinfo,0); |
48 | 48 | eosBayesDistributionInit(&(d->likelihood[i]),llinfo,0); |
@@ -37,9 +37,9 @@ void eosBayesDistributionInit(eosBayesDistribution* d, eosBayesDistributionInfo* | ||
37 | 37 | d->value[i] = d->min+(d->delta*i); |
38 | 38 | } |
39 | 39 | |
40 | +/*to swich after*/ | |
40 | 41 | if(mode==0){ |
41 | 42 | info->mode = eosBayesDistributionInfoModeGaussian; |
42 | 43 | } |
43 | 44 | |
44 | - | |
45 | 45 | } |
@@ -20,7 +20,7 @@ static char __sccs_id[] = "%Z%eosBayesEstimation ver%I%; Date:%D% %Z%"; | ||
20 | 20 | #define DEBUG |
21 | 21 | #include "genUtil.h" |
22 | 22 | |
23 | -void eosBayesEstimation(eosBayes* d, int mode, FILE* fpt){ | |
23 | +void eosBayesEstimation(eosBayes* d, int mode){ | |
24 | 24 | int i; |
25 | 25 | int j; |
26 | 26 | float sum = 0; |
@@ -36,15 +36,11 @@ void eosBayesEstimation(eosBayes* d, int mode, FILE* fpt){ | ||
36 | 36 | for(j=0;j<d->prior[i].n;j++){ |
37 | 37 | d->posterior[i].prob[j] /= sum; |
38 | 38 | DEBUGPRINT1("post:%f\n",d->posterior[i].prob[j]); |
39 | - fprintf(fpt,"%f\n",d->posterior[i].prob[j]); | |
40 | 39 | } |
41 | - fprintf(fpt,"\n"); | |
42 | 40 | |
43 | - DEBUGPRINT2("%dDistribution num:%d",i,d->prior[i].n); | |
41 | + DEBUGPRINT2("%dDistribution num:%d\n",i,d->prior[i].n); | |
44 | 42 | } |
45 | 43 | |
46 | - fclose(fpt); | |
47 | - | |
48 | 44 | } |
49 | 45 | |
50 | 46 |
@@ -61,3 +57,23 @@ void eosBayesPosteriortoPrior(eosBayes* d,int mode){ | ||
61 | 57 | } |
62 | 58 | |
63 | 59 | } |
60 | + | |
61 | +void eosBayesloop(eosBayesDistribution* d, int* L, int numDist, int length){ | |
62 | + | |
63 | + int N1; | |
64 | + int N2; | |
65 | + | |
66 | + int i; | |
67 | + | |
68 | + N1=1; | |
69 | + N2=1; | |
70 | + | |
71 | + for(i=0;i<numDist-1;i++){ | |
72 | + N2 = d[i].n; | |
73 | + L[i] = (length/N1)%N2; | |
74 | + N1 *= d[i].n; | |
75 | + } | |
76 | + L[numDist-1] = length/N1; | |
77 | + | |
78 | + | |
79 | +} |
@@ -32,9 +32,9 @@ void eosBayesDistributionWrite(FILE* fpt, eosBayesDistribution* d, int mode){ | ||
32 | 32 | DEBUGPRINT4("#dist: %f\t%f\t%f\t%d\n",d->min,d->max,d->delta,d->n); |
33 | 33 | for(i=0;i<d->n;i++){ |
34 | 34 | fprintf(fpt,"%f\n",d->prob[i]); |
35 | - DEBUGPRINT1("%f\n",d->prob[i]); | |
35 | + DEBUGPRINT2("%f %f\n",d->value[i],d->prob[i]); | |
36 | 36 | } |
37 | - fprintf(fpt,"#end\n"); | |
37 | + fprintf(fpt,"#end\n\n"); | |
38 | 38 | |
39 | 39 | break; |
40 | 40 | case 2: |
@@ -90,7 +90,7 @@ void eosBayesWrite(FILE* fpt, eosBayes* d, int mode){ | ||
90 | 90 | } |
91 | 91 | |
92 | 92 | |
93 | -extern void DistributionChangeCheck(eosBayes* d, int mode){ | |
93 | +void DistributionChangeCheck(eosBayes* d, int mode){ | |
94 | 94 | |
95 | 95 | FILE* fpt; |
96 | 96 | int i; |
@@ -116,7 +116,7 @@ extern void DistributionChangeCheck(eosBayes* d, int mode){ | ||
116 | 116 | for(j=0;j<d->prior[i].n;j++){ |
117 | 117 | fprintf(fpt,"%f %f\n",d->prior[i].value[j],d->prior[i].prob[j]); |
118 | 118 | } |
119 | - fprintf(fpt,"\n"); | |
119 | + fprintf(fpt,"\n\n"); | |
120 | 120 | |
121 | 121 | fclose(fpt); |
122 | 122 | break; |
@@ -131,9 +131,9 @@ extern void DistributionChangeCheck(eosBayes* d, int mode){ | ||
131 | 131 | for(j=0;j<d->posterior[i].n;j++){ |
132 | 132 | fprintf(fpt,"%f %f\n",d->posterior[i].value[j],d->posterior[i].prob[j]); |
133 | 133 | } |
134 | - fprintf(fpt,"\n"); | |
135 | - | |
134 | + fprintf(fpt,"\n\n"); | |
136 | 135 | |
136 | + fclose(fpt); | |
137 | 137 | break; |
138 | 138 | |
139 | 139 |
@@ -148,3 +148,51 @@ extern void DistributionChangeCheck(eosBayes* d, int mode){ | ||
148 | 148 | |
149 | 149 | |
150 | 150 | } |
151 | + | |
152 | + | |
153 | +void LikelihoodChangeCheck(eosBayes* d, int count, int mode){ | |
154 | + | |
155 | + FILE* fpt; | |
156 | + int i; | |
157 | + int j; | |
158 | + char s[1024]; | |
159 | + | |
160 | + for(i=0;i<d->numDistribution;i++){ | |
161 | + sprintf(s,"%s%d.out","./data/likelihood",i); | |
162 | + | |
163 | + | |
164 | + if(count == 0){ | |
165 | + | |
166 | + if((fpt=fopen(s,"w"))==NULL){ | |
167 | + fprintf(stderr,"fopen error: %s\n",s); | |
168 | + exit(1); | |
169 | + } | |
170 | + | |
171 | + fprintf(fpt,"#dist: %f\t%f\t%f\t%d\n",d->likelihood[i].min,d->likelihood[i].max,d->likelihood[i].delta,d->likelihood[i].n); | |
172 | + for(j=0;j<d->likelihood[i].n;j++){ | |
173 | + fprintf(fpt,"%f %f\n",d->likelihood[i].value[j],d->likelihood[i].prob[j]); | |
174 | + } | |
175 | + fprintf(fpt,"\n\n"); | |
176 | + | |
177 | + fclose(fpt); | |
178 | + | |
179 | + }else if(count > 0){ | |
180 | + | |
181 | + if((fpt=fopen(s,"a"))==NULL){ | |
182 | + fprintf(stderr,"fopen error: %s\n",s); | |
183 | + exit(1); | |
184 | + } | |
185 | + | |
186 | + for(j=0;j<d->likelihood[i].n;j++){ | |
187 | + fprintf(fpt,"%f %f\n",d->likelihood[i].value[j],d->likelihood[i].prob[j]); | |
188 | + } | |
189 | + fprintf(fpt,"\n\n"); | |
190 | + | |
191 | + fclose(fpt); | |
192 | + | |
193 | + } | |
194 | + | |
195 | + } | |
196 | + | |
197 | + | |
198 | +} |
@@ -18,14 +18,14 @@ static char __sccs_id[] = "%Z%leosBayesInit ver%I%; Date:%D% %Z%"; | ||
18 | 18 | #include "../inc/eosBayes.h" |
19 | 19 | |
20 | 20 | |
21 | -void leosBayesInit(eosBayes* b, int numDistribution, int numLikelihood, int mode){ | |
21 | +void leosBayesInit(eosBayes* d, int numDistribution, int numLikelihood, int mode){ | |
22 | 22 | |
23 | - b->numDistribution = numDistribution; | |
24 | - b->numLikelihood = numLikelihood; | |
23 | + d->numDistribution = numDistribution; | |
24 | + d->numLikelihood = numLikelihood; | |
25 | 25 | |
26 | - b->prior = (eosBayesDistribution*)malloc(sizeof(eosBayesDistribution)*numDistribution); | |
27 | - b->posterior = (eosBayesDistribution*)malloc(sizeof(eosBayesDistribution)*numDistribution); | |
26 | + d->prior = (eosBayesDistribution*)malloc(sizeof(eosBayesDistribution)*numDistribution); | |
27 | + d->posterior = (eosBayesDistribution*)malloc(sizeof(eosBayesDistribution)*numDistribution); | |
28 | 28 | |
29 | - b->likelihood = (eosBayesDistribution*)malloc(sizeof(eosBayesDistribution)*numLikelihood); | |
29 | + d->likelihood = (eosBayesDistribution*)malloc(sizeof(eosBayesDistribution)*numLikelihood); | |
30 | 30 | |
31 | 31 | } |
@@ -8,3 +8,4 @@ WORLDNAME=Tools | ||
8 | 8 | WORLDNAME=Tools |
9 | 9 | WORLDNAME=Tools |
10 | 10 | WORLDNAME=Tools |
11 | +WORLDNAME=Tools |
@@ -1 +0,0 @@ | ||
1 | -/Users/hisanagakouji/Eos/src/Config/Template/ToolsHomeTemplate.Dir/Makefile | |
\ No newline at end of file |
@@ -0,0 +1,5 @@ | ||
1 | +include ../Config/Define.inc | |
2 | +include Config/Define.inc | |
3 | +include .Source | |
4 | + | |
5 | +include Config/Target.inc |
@@ -40,105 +40,69 @@ typedef enum lctfDeterminationByBayesMode { | ||
40 | 40 | int |
41 | 41 | main(int argc, char* argv[]) |
42 | 42 | { |
43 | + | |
44 | + ctfDeterminationByBayesInfo info; | |
45 | + ctfInfo ctfinfo; | |
46 | + eosBayesDistributionInfo llinfo; | |
47 | + | |
48 | + eosBayes out; | |
49 | + ctfforbayes ctf; | |
50 | + int i; | |
43 | 51 | |
44 | - ctfDeterminationByBayesInfo info; | |
45 | - ctfInfo ctfinfo; | |
46 | - eosBayesDistributionInfo llinfo; | |
52 | + init0(&info); | |
53 | + argCheck(&info, argc, argv); | |
54 | + init1(&info); | |
47 | 55 | |
48 | - eosBayes out; | |
49 | - ctfforbayes ctf; | |
50 | - int i; | |
56 | + DEBUGPRINT("Program Start\n"); | |
51 | 57 | |
52 | - FILE* fout; | |
53 | - FILE* fout2; | |
54 | - FILE* fout3; | |
55 | - FILE* fout4; | |
56 | - FILE* fout5; | |
58 | + ctfinfo.mode = 33; | |
57 | 59 | |
58 | 60 | |
59 | - char s[1024]; | |
61 | + leosBayesInit(&out, info.numDistribution, info.numLikelihood, info.mode); | |
62 | + eosBayesCondition(info.fptIn, &out, &llinfo, 0); | |
63 | + eosBayesPriorWrite(info.fptOut2, &out,0); | |
64 | + DistributionChangeCheck(&out, 0); | |
60 | 65 | |
61 | - init0(&info); | |
62 | - argCheck(&info, argc, argv); | |
63 | - init1(&info); | |
64 | 66 | |
65 | - DEBUGPRINT("Program Start\n"); | |
67 | + ctfforbayesInit(info.fptIn2,&ctf,0); | |
68 | + spatialfrequencyRead(info.fptIn2,&ctf,0); | |
69 | + ctfInfoRead(info.fptIn3,&ctfinfo,"",0); | |
70 | + DEBUGPRINT4("kV:%f Cs:%f Ain:%f ctfMode:%d\n",ctfinfo.kV,ctfinfo.Cs,ctfinfo.Ain,ctfinfo.mode); | |
71 | + DEBUGPRINT1("flagIn4:%d\n",info.flagIn4); | |
66 | 72 | |
67 | - ctfinfo.mode = 32; | |
68 | - | |
69 | - | |
70 | - leosBayesInit(&out, info.numDistribution, info.numLikelihood, info.mode); | |
71 | - eosBayesCondition(info.fptIn, &out, &llinfo, 0); | |
72 | - eosBayesPriorWrite(info.fptOut2, &out,0); | |
73 | - DistributionChangeCheck(&out, 0); | |
74 | - | |
75 | - | |
76 | - ctfforbayesInit(info.fptIn2,&ctf,0); | |
77 | - spatialfrequencyRead(info.fptIn2,&ctf,0); | |
78 | - ctfInfoRead(info.fptIn3,&ctfinfo,"",0); | |
79 | - DEBUGPRINT3("kV:%f Cs:%f Ain:%f\n",ctfinfo.kV,ctfinfo.Cs,ctfinfo.Ain); | |
80 | - | |
81 | - for(i=0;i<info.flagIn4;i++){ | |
82 | - | |
83 | - sprintf(s,"%s%d.out","./data/intensity",i); | |
84 | - if((fout4=fopen(s,"w"))==NULL){ | |
85 | - fprintf(stderr,"fopen error: %s\n",s); | |
86 | - exit(1); | |
87 | - } | |
88 | - IntensityRead(info.In4[i],&ctf,0,fout4); | |
89 | - | |
90 | - | |
91 | - | |
92 | - DEBUGPRINT("ctf start\n"); | |
93 | - sprintf(s,"%s%d.out","./data/ctf",i); | |
94 | - if((fout=fopen(s,"w"))==NULL){ | |
95 | - fprintf(stderr,"fopen error: %s\n",s); | |
96 | - exit(1); | |
97 | - } | |
98 | - ctfFunctionforbayes(&ctf,out.likelihood,&ctfinfo,out.numLikelihood,0,fout); | |
99 | - | |
100 | - | |
101 | - DEBUGPRINT("likelihood start\n"); | |
102 | - sprintf(s,"%s%d.out","./data/likelihood",i); | |
103 | - if((fout2=fopen(s,"w"))==NULL){ | |
104 | - fprintf(stderr,"fopen error: %s\n",s); | |
105 | - exit(1); | |
106 | - } | |
107 | - | |
108 | - sprintf(s,"%s%d.out","./data/IandII",i); | |
109 | - if((fout5=fopen(s,"w"))==NULL){ | |
110 | - fprintf(stderr,"fopen error: %s\n",s); | |
111 | - exit(1); | |
112 | - } | |
113 | - | |
114 | - | |
115 | - defocuslikelihoodcaluculation(ctf,out.likelihood,out.numLikelihood,0,fout2,fout5); | |
116 | 73 | |
74 | + /*defocus estimation*/ | |
75 | + for(i=0;i<info.flagIn4;i++){ | |
76 | + | |
77 | + IntensityRead(info.In4[i],&ctf,0); | |
78 | + | |
79 | + DEBUGPRINT("ctf start\n"); | |
80 | + ctfFunctionforbayes(&ctf,out.likelihood,&ctfinfo,out.numLikelihood,i,0); | |
117 | 81 | |
118 | - DEBUGPRINT("estimate start\n"); | |
119 | - sprintf(s,"%s%d.out","./data/posterior",i); | |
120 | - if((fout3=fopen(s,"w"))==NULL){ | |
121 | - fprintf(stderr,"fopen error: %s\n",s); | |
122 | - exit(1); | |
123 | - } | |
124 | - eosBayesEstimation(&out,0,fout3); | |
82 | + DEBUGPRINT("likelihood start\n"); | |
125 | 83 | |
126 | - DistributionChangeCheck(&out,1); | |
84 | + defocuslikelihood(ctf,&out,i,0); | |
85 | + LikelihoodChangeCheck(&out,i,0); | |
127 | 86 | |
128 | - DEBUGPRINT("change start\n"); | |
129 | - eosBayesPosteriortoPrior(&out,0); | |
130 | - DEBUGPRINT("loop end\n"); | |
87 | + DEBUGPRINT("estimate start\n"); | |
88 | + eosBayesEstimation(&out,0); | |
131 | 89 | |
132 | - } | |
133 | - | |
134 | - eosBayesPriorWrite(info.fptOut,&out,0); | |
90 | + DistributionChangeCheck(&out,1); | |
91 | + | |
92 | + DEBUGPRINT("change start\n"); | |
93 | + eosBayesPosteriortoPrior(&out,0); | |
94 | + DEBUGPRINT("loop end\n"); | |
135 | 95 | |
136 | - exit(EXIT_SUCCESS); | |
96 | + } | |
97 | + | |
98 | + eosBayesPriorWrite(info.fptOut,&out,0); | |
99 | + | |
100 | + exit(EXIT_SUCCESS); | |
137 | 101 | } |
138 | 102 | |
139 | 103 | void |
140 | 104 | additionalUsage() |
141 | 105 | { |
142 | - fprintf(stderr, "----- Additional Usage -----\n"); | |
106 | + fprintf(stderr, "----- Additional Usage -----\n"); | |
143 | 107 | } |
144 | 108 |
@@ -7,11 +7,11 @@ all: help exec | ||
7 | 7 | |
8 | 8 | help: |
9 | 9 | @echo "----- Help Message Check -----" |
10 | - @../$(OSTYPE)/$(OBJECTNAME) -h | |
10 | + @../$(OSTYPE)/$(OBJECTNAME) -h | |
11 | 11 | |
12 | 12 | exec: |
13 | 13 | @echo "----- Execution Check -----" |
14 | - ../$(OSTYPE)/$(OBJECTNAME) -i ./data/test.in -i2 ./data/121ptest.R.txt -i3 ./data/ctfInfo -i4 ./data/testList.in -o ./data/posterior.out -O ./data/prior.out -n 3 3 | |
15 | - @echo "----- Calc check -----" | |
14 | + ../$(OSTYPE)/$(OBJECTNAME) -i ./data/test.in -i2 ./data/disc.ctf.fft.spec.R -i3 ./data/ctfInfo -i4 ./data/testList.in -o ./data/posterior.out -O ./data/prior.out -n 3 3 | |
15 | + @echo "----- Calc check -----" | |
16 | 16 | |
17 | 17 | clean: |
@@ -1,17 +0,0 @@ | ||
1 | -include ../../Config/Define.inc | |
2 | -include ../../../Config/Define.inc | |
3 | -include ../../../../Config/Define.inc | |
4 | -include ../../../../../Config/Define.inc | |
5 | - | |
6 | -all: help exec | |
7 | - | |
8 | -help: | |
9 | - @echo "----- Help Message Check -----" | |
10 | - @../$(OSTYPE)/$(OBJECTNAME) -h | |
11 | - | |
12 | -exec: | |
13 | - @echo "----- Execution Check -----" | |
14 | - ../$(OSTYPE)/$(OBJECTNAME) -i ./data/test.in -i2 ./data/121ptest.R.txt -i3 ./data/ctfInfo -i4 ./data/testList.in -o ./data/posterior.out -O ./data/prior.out -n 3 3 | |
15 | - @echo "----- Calc check -----" | |
16 | - | |
17 | -clean: |
@@ -2,7 +2,7 @@ | ||
2 | 2 | # FileFormat |
3 | 3 | "-i","-i[nput]","Input:2D","Essential","1","1","In","inFile::mrcImage","stdin" |
4 | 4 | "-o","-o[utput]","Output:2D","Essential","1","1","Out","outFile::mrcImage","stdout" |
5 | -"-ctf","-ctf","Input:ctfInfo","Essential","1","1","CTF","inFile::ASCII","stdin" | |
5 | +"-ctf","-ctf","Input:ctfInfo","Optional","1","1","CTF","inFile::ASCII","stdin" | |
6 | 6 | "-kV","-kV","AccVol[kV]","Optional","1","1","kV","Real","200" |
7 | 7 | "-Cs","-Cs","Cs[mm]","Optional","1","1","Cs","Real","2.1" |
8 | 8 | "-df","-df","Defocus [A]:under(+)","Optional","1","1","Defocus","Real","27000" |
@@ -54,11 +54,6 @@ init1(mrcImageCTFObservationInfo* info) | ||
54 | 54 | info->fptOut = fileOpen(info->Out, "w"); |
55 | 55 | } |
56 | 56 | |
57 | - if(!info->flagCTF) { | |
58 | - stringGetFromFile(s, "CTF", stdin, stdout, 0); | |
59 | - info->CTF = stringGetNthWord(s, 1, " ,\t"); | |
60 | - info->flagCTF++; | |
61 | - } | |
62 | 57 | if(info->flagCTF) { |
63 | 58 | info->fptCTF = fileOpen(info->CTF, "r"); |
64 | 59 | } |
@@ -10,7 +10,7 @@ Usage: mrcImageCTFObservation | ||
10 | 10 | Options: |
11 | 11 | [-i[nput] In (stdin ).as(inFile::mrcImage ) ] :Essential :Input:2D |
12 | 12 | [-o[utput] Out (stdout ).as(outFile::mrcImage ) ] :Essential :Output:2D |
13 | - [-ctf CTF (stdin ).as(inFile::ASCII ) ] :Essential :Input:ctfInfo | |
13 | + [-ctf CTF (stdin ).as(inFile::ASCII ) ] :Optional :Input:ctfInfo | |
14 | 14 | [-kV kV (200 ).as(Real ) ] :Optional :AccVol[kV] |
15 | 15 | [-Cs Cs (2.1 ).as(Real ) ] :Optional :Cs[mm] |
16 | 16 | [-df Defocus (27000 ).as(Real ) ] :Optional :Defocus [A]:under(+) |
@@ -9,7 +9,7 @@ | ||
9 | 9 | -Q 1 0 5.25x1+47+0 'Close' |
10 | 10 | -I 1 0 1 1 0 1 -1x1+1+1.500000 ' ' 'In' 'Input:2D' i |
11 | 11 | -O 1 0 1 1 0 1 -1x1+1+3.000000 ' ' 'Out' 'Output:2D' o |
12 | - -I 1 0 1 1 0 1 -1x1+1+4.500000 ' ' 'CTF' 'Input:ctfInfo' ctf | |
12 | + -I 1 0 1 0 0 1 -1x1+1+4.500000 ' ' 'CTF' 'Input:ctfInfo' ctf | |
13 | 13 | -f 1 0 1 0 0 -1x1+1+6.000000 0 0 200.000000 0 0 0 'kV' 'AccVol[kV]' kV |
14 | 14 | -f 1 0 1 0 0 -1x1+1+7.500000 0 0 2.100000 0 0 0 'Cs' 'Cs[mm]' Cs |
15 | 15 | -f 1 0 1 0 0 -1x1+1+9.000000 0 0 27000.000000 0 0 0 'Defocus' 'Defocus [A]:under(+)' df |
@@ -9,7 +9,7 @@ usage(char* thisProgram) | ||
9 | 9 | fprintf(stderr, "Options:\n"); |
10 | 10 | fprintf(stderr, " [-i[nput] In (stdin ).as(inFile::mrcImage ) ] :Essential :Input:2D\n"); |
11 | 11 | fprintf(stderr, " [-o[utput] Out (stdout ).as(outFile::mrcImage ) ] :Essential :Output:2D\n"); |
12 | - fprintf(stderr, " [-ctf CTF (stdin ).as(inFile::ASCII ) ] :Essential :Input:ctfInfo\n"); | |
12 | + fprintf(stderr, " [-ctf CTF (stdin ).as(inFile::ASCII ) ] :Optional :Input:ctfInfo\n"); | |
13 | 13 | fprintf(stderr, " [-kV kV (200 ).as(Real ) ] :Optional :AccVol[kV]\n"); |
14 | 14 | fprintf(stderr, " [-Cs Cs (2.1 ).as(Real ) ] :Optional :Cs[mm]\n"); |
15 | 15 | fprintf(stderr, " [-df Defocus (27000 ).as(Real ) ] :Optional :Defocus [A]:under(+)\n"); |