#define DEBUG
#include "genUtil.h"
#include "ctfDeterminationByBayes.h"
-#include "String.h"
+#include "eosString.h"
/*
Example:
{
int i;
- int j;
ctfDeterminationByBayesInfo info;
ctfInfo ctfinfo;
init1(&info);
DEBUGPRINT("Program Start\n");
+ DEBUGPRINT("local binary:MTF plus\n");
ctfinfo.mode = 33;
DEBUGPRINT6("kV:%f Cs:%f Ain:%f Cc:%f MTF:%f ctfMode:%ld\n",ctfinfo.kV,ctfinfo.Cs,ctfinfo.Ain,ctfinfo.Cc,ctfinfo.BofMTF,ctfinfo.mode);
-
/*ctfInfoflagcheck*/
-
DEBUGPRINT2("flagAliasing:%ld flagSampling:%ld\n",ctfinfo.flagAliasing,ctfinfo.flagSampling);
DEBUGPRINT1("NyquistFrequency:%f\n",ctfinfo.NyquistFrequency);
+ ctfinfo.flagMolecEnvTable = 0;
DEBUGPRINT1("flagMolecEnvTable:%ld\n",ctfinfo.flagMolecEnvTable);
+ ctfinfo.flagElastic = 0;
DEBUGPRINT1("flagElastic:%ld\n",ctfinfo.flagElastic);
+ ctfinfo.flagWithInElasticTable = 0;
DEBUGPRINT1("flagWithInElasticEnvTable:%ld\n",ctfinfo.flagWithInElasticTable);
+ ctfinfo.flagInElastic = 0;
DEBUGPRINT1("flagInElastic:%ld\n",ctfinfo.flagInElastic);
+ ctfinfo.flagWithInElastic = 0;
DEBUGPRINT1("flagWithInElastic:%ld\n",ctfinfo.flagWithInElastic);
+ ctfinfo.flagVibration = 0;
DEBUGPRINT1("flagVibration:%ld\n",ctfinfo.flagVibration);
+ ctfinfo.VibrationMode = 0;
DEBUGPRINT1("VibrationMode:%ld\n",ctfinfo.VibrationMode);
+ ctfinfo.Magnification = 0;
DEBUGPRINT1("Magnification:%f\n",ctfinfo.Magnification);
+ ctfinfo.flagMagnification = 0;
DEBUGPRINT1("flagMagnification:%ld\n",ctfinfo.flagMagnification);
-
-
DEBUGPRINT1("flagIn4:%ld\n",info.flagIn4);
Rmax = ctf.rmax;
/*df,A B serch*/
- DEBUGPRINT("df, A, k search start\n");
+ DEBUGPRINT("df, A, B search start\n");
ctf.rmax = Rintermediate;
ctf.rmin = Rmin;
DEBUGPRINT2("set R range:%f~%f\n",ctf.rmin,ctf.rmax);
DEBUGPRINT("set resetflag of df,k\n");
out.prior[0].resetflag = 1;
out.prior[1].resetflag = 1;
- out.prior[2].resetflag = 1;
eosBayesProbabilityReset(info.fptIn,&out,1,0);
+ DEBUGPRINT("set rangechangeflag of B\n");
+ eosBayesRangeChangeflagSet(&out,2,0.95,20);
+ eosBayesProbabilityRangeChange(&out,0);
+
+
DistributionChangeCheck(&out, 4, 0);
DEBUGPRINT("----maxflagcheck----\n");
#ifdef DEBUG
#endif
DefocusEstimationLoop(info,&out,&ctfinfo,&ctf,&intensity,&likelihood,4,1);
- DEBUGPRINT("A,df,k search finish\n");
+ DEBUGPRINT("A,B,df search finish\n");
ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1);
- /*df,A serch*/
-
- DEBUGPRINT("df, A, k search start\n");
+ /*df,A, B 2 serch*/
+ DEBUGPRINT("df, A, B search 2 start\n");
ctf.rmax = Rintermediate;
ctf.rmin = Rmin;
DEBUGPRINT2("set R range:%f~%f\n",ctf.rmin,ctf.rmax);
eosBayesMaxposteriorflagSet(&out,4);
DEBUGPRINT("set canstantflag of Ain");
- out.posterior[5].constantflag = 1;
out.posterior[3].constantflag = 1;
+ out.posterior[5].constantflag = 1;
DEBUGPRINT("set resetflag of df,k\n");
out.prior[0].resetflag = 1;
#ifdef DEBUG
for(i=0;i<out.numDistribution;i++){
printf("dist%d:%d\n",i,(out.posterior[i].maxposteriorflag));
+ printf("rangechange%d:%d\n",i,(out.posterior[i].rangechangeflag));
+
}
#endif
ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1);
-/*Defocus ref*/
+ /*Defocus ref*/
DEBUGPRINT("defocus refinement start\n");
ctf.rmax = Rmax;
ctf.rmin = Rfirstpeak;
out.posterior[0].maxposteriorflag = 0;
out.posterior[1].maxposteriorflag = 0;
out.posterior[3].maxposteriorflag = 0;
+ out.posterior[4].maxposteriorflag = 0;
out.posterior[5].maxposteriorflag = 0;
- eosBayesMaxposteriorflagSet(&out,4);
+ // eosBayesMaxposteriorflagSet(&out,4);
DEBUGPRINT("set canstantflag of Ain");
out.posterior[3].constantflag = 0;
eosBayesRangeChangeflagSet(&out,0,0.70,10);
eosBayesRangeChangeflagSet(&out,1,0.95,20);
eosBayesRangeChangeflagSet(&out,2,0.95,20);
-// eosBayesRangeChangeflagSet(&out,4,0.70,5);
+ eosBayesRangeChangeflagSet(&out,4,0.40,5);
eosBayesProbabilityRangeChange(&out,0);
-
DistributionChangeCheck(&out, 6, 0);
defocusLikelihoodInit(&likelihood,&out,1);