WORLDNAME=Tools
WORLDNAME=Tools
WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
z=(pz / in->HeaderLength.z - in->HeaderStartN.z);
*/
//mrcPixelDataGet(in, x, y, z, &data, mrcPixelRePart, mrcPixelHowNearest);
- mrcImageDataGetbyAU(in, x, y, z, &data, mrcPixelRePart, mrcPixelHowNearest);
+ mrcImageDataGetbyAU(in, px, py, pz, &data, mrcPixelRePart, mrcPixelHowNearest);
data *= v;
if (flagH){
if (data > H){
# FileFormat
"-i","-i[nput]","Input: MRC","Essential","1","1","In","inFile","NULL"
"-o","-o[utput]","Output: MRC","Essential","1","1","Out","outFile","NULL"
-"-Max","-Max[Size]","Input: [A]","Optional","1","1","MaxSize","Real","100.0"
+"-RR","-R[ing]R[adius]","Input: [A]","Optional","1","1","RingRadius","Real","100.0"
+"-RW","-R[ing]W[idth]","Input: [A]","Optional","1","1","RingWidth","Real","10.0"
+"-thres","-thres[hold]","Input: threshold of IQ","Optional","1","1","Threshold","Real","3.0"
+"-out","-out[Threshold]","Output: Output","Optional","1","1","outFileThres","outFile","stdout"
"-c","-c[onfig]","ConfigurationFile","Optional","1","1","configFile","inFile","NULL"
"-m","-m[ode]","Mode","Optional","1","1","mode","Integer","0"
char* Out;
FILE* fptOut;
- long flagMaxSize;
- float MaxSize;
+ long flagRingRadius;
+ float RingRadius;
+
+ long flagRingWidth;
+ float RingWidth;
+
+ long flagThreshold;
+ float Threshold;
+
+ long flagoutFileThres;
+ char* outFileThres;
+ FILE* fptoutFileThres;
long flagconfigFile;
char* configFile;
}
SBREAK;
}
- SCASE("Max") {
+ SCASE("RR") {
if(i+1<argc) {
- info->MaxSize = stringGetNthRealData(argv[i+1], 1, " ,");
+ info->RingRadius = stringGetNthRealData(argv[i+1], 1, " ,");
i++;
- info->flagMaxSize++;
+ info->flagRingRadius++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("RW") {
+ if(i+1<argc) {
+ info->RingWidth = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagRingWidth++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("thres") {
+ if(i+1<argc) {
+ info->Threshold = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagThreshold++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("out") {
+ if(i+1<argc) {
+ info->outFileThres = stringGetNthWord(argv[i+1], 1, " ,");
+ i++;
+ info->flagoutFileThres++;
} else {
usage(argv[0]);
exit(EXIT_FAILURE);
{
info->fptIn = NULL; info->flagIn = 0;
info->fptOut = NULL; info->flagOut = 0;
- info->MaxSize = 100.0; info->flagMaxSize = 0;
+ info->RingRadius = 100.0; info->flagRingRadius = 0;
+ info->RingWidth = 10.0; info->flagRingWidth = 0;
+ info->Threshold = 3.0; info->flagThreshold = 0;
+ info->fptoutFileThres = stdout; info->flagoutFileThres = 0;
info->fptconfigFile = NULL; info->flagconfigFile = 0;
info->mode = 0; info->flagmode = 0;
}
info->fptOut = fileOpen(info->Out, "w");
}
- if(info->flagMaxSize) {
+ if(info->flagRingRadius) {
+ }
+
+ if(info->flagRingWidth) {
+ }
+
+ if(info->flagThreshold) {
+ }
+
+ if(info->flagoutFileThres) {
+ info->fptoutFileThres = fileOpen(info->outFileThres, "w");
}
if(info->flagconfigFile) {
} lmrcImageParticleCandidateExtractMode;
typedef struct lmrcImageParticleCandidateExtractInfo {
- float Max; // A
+ float RingRadius; // A
+ float RingWidth; // A
+ float Threshold;
+ FILE* fptThreshold;
} lmrcImageParticleCandidateExtractInfo;
init1(&info);
DEBUGPRINT("Program Start\n");
- linfo.Max = info.MaxSize;
-
+ linfo.RingRadius = info.RingRadius;
+ linfo.RingWidth = info.RingWidth;
+ linfo.Threshold = info.Threshold;
+ linfo.fptThreshold = info.fptoutFileThres;
mrcFileRead(&in, info.In, "in main", 0);
lmrcImageParticleCandidateExtract(&out, &in, linfo, info.mode);
lmrcImageParticleCandidateExtract(mrcImage* out, mrcImage* in, lmrcImageParticleCandidateExtractInfo linfo, lmrcImageParticleCandidateExtractMode mode)
{
mrcImageParaTypeReal x, y, z;
+ mrcImageParaTypeReal xx, yy, zz;
+ mrcImageParaTypeReal RR, RW;
+ double RIN, ROUT;
+ double R2;
+ double RIN2, ROUT2;
+ double testdata, data;
+ double sum, sum2;
+ double sd, mean;
+ double IQ;
+ int n;
+ int working, all;
+
+ out->Header = in->Header;
+ mrcInit(out, NULL);
+
+ // Real Space
+ RIN2 = SQR(linfo.RingRadius);
+ ROUT2 = SQR(linfo.RingRadius+linfo.RingWidth);
+ // Pixel
+ RR = MAX(MAX(linfo.RingRadius/in->HeaderLength.x, linfo.RingRadius/in->HeaderLength.y), linfo.RingRadius/in->HeaderLength.z);
+ RW = MAX(MAX(linfo.RingWidth /in->HeaderLength.x, linfo.RingWidth /in->HeaderLength.y), linfo.RingWidth /in->HeaderLength.z);
+ RIN = RR;
+ ROUT = RR + RW;
+
+ all = in->HeaderN.x*in->HeaderN.y*in->HeaderN.z;
+ working = 0;
for(z=0; z<in->HeaderN.z; z++) {
for(y=0; y<in->HeaderN.y; y++) {
for(x=0; x<in->HeaderN.x; x++) {
+ if(working*100/all==working*100.0/(double)all) {
+ fprintf(stderr, "%d%\n", working*100/all);
+ }
+ working++;
+ mrcPixelDataGet(in, x, y, z, &testdata, mrcPixelRePart, mrcPixelHowNearest);
+ sum = 0;
+ sum2 = 0;
+ n = 0;
+ for(zz=z-ROUT; zz<=z+ROUT; zz++) {
+ for(yy=y-ROUT; yy<=y+ROUT; yy++) {
+ for(xx=x-ROUT; xx<=x+ROUT; xx++) {
+ R2 = SQR((xx-x)*in->HeaderLength.x) + SQR((yy-y)*in->HeaderLength.y) + SQR((zz-z)*in->HeaderLength.z);
+ if(RIN2 <= R2 && R2 <= ROUT2) {
+ if(-0.5 <= xx && xx < in->HeaderN.x-0.5
+ &&-0.5 <= yy && yy < in->HeaderN.y-0.5
+ &&-0.5 <= zz && zz < in->HeaderN.z-0.5) {
+ mrcPixelDataGet(in, xx, yy, zz, &data, mrcPixelRePart, mrcPixelHowNearest);
+ sum += data;
+ sum2 += data*data;
+ n++;
+ }
+ }
+ }
+ }
+ }
+ if(0<n) {
+ mean = sum/n;
+ sd = sqrt(sum2/n - SQR(mean));
+ IQ = (testdata - mean)/sd;
+ if(0<linfo.Threshold) {
+ if(linfo.Threshold<IQ) {
+ fprintf(linfo.fptThreshold, "%f %f %f %f\n", x, y, z, IQ);
+ }
+ } else {
+ if(IQ<linfo.Threshold) {
+ fprintf(linfo.fptThreshold, "%f %f %f %f\n", x, y, z, IQ);
+ }
+ }
+ } else {
+ IQ = 0;
+ }
+ mrcPixelDataSet(out, x, y, z, IQ, mrcPixelRePart);
}
}
}
}
+
Options:
[-i[nput] In (NULL )] :Essential :Input: MRC
[-o[utput] Out (NULL )] :Essential :Output: MRC
- [-Max[Size] MaxSize (100.0 )] :Optional :Input: [A]
+ [-R[ing]R[adius] RingRadius (100.0 )] :Optional :Input: [A]
+ [-R[ing]W[idth] RingWidth (10.0 )] :Optional :Input: [A]
+ [-thres[hold] Threshold (3.0 )] :Optional :Input: threshold of IQ
+ [-out[Threshold] outFileThres (stdout )] :Optional :Output: Output
[-c[onfig] configFile (NULL )] :Optional :ConfigurationFile
[-m[ode] mode (0 )] :Optional :Mode
----- Additional Usage -----
-Q 1 0 5.25x1+47+0 'Close'
-I 1 0 1 1 0 1 -1x1+1+1.500000 ' ' 'In' 'Input: MRC' i
-O 1 0 1 1 0 1 -1x1+1+3.000000 ' ' 'Out' 'Output: MRC' o
- -f 1 0 1 0 0 -1x1+1+4.500000 0 0 100.000000 0 0 0 'MaxSize' 'Input: [A]' Max
- -I 1 0 1 0 0 1 -1x1+1+6.000000 ' ' 'configFile' 'ConfigurationFile' c
- -i 1 0 1 0 0 -1x1+1+7.500000 0 0 0 0 0 'mode' 'Mode' m
+ -f 1 0 1 0 0 -1x1+1+4.500000 0 0 100.000000 0 0 0 'RingRadius' 'Input: [A]' RR
+ -f 1 0 1 0 0 -1x1+1+6.000000 0 0 10.000000 0 0 0 'RingWidth' 'Input: [A]' RW
+ -f 1 0 1 0 0 -1x1+1+7.500000 0 0 3.000000 0 0 0 'Threshold' 'Input: threshold of IQ' thres
+ -O 1 0 1 0 0 1 -1x1+1+9.000000 ' ' 'outFileThres' 'Output: Output' out
+ -I 1 0 1 0 0 1 -1x1+1+10.500000 ' ' 'configFile' 'ConfigurationFile' c
+ -i 1 0 1 0 0 -1x1+1+12.000000 0 0 0 0 0 'mode' 'Mode' m
-E
-E
-E
fprintf(stderr, "Options:\n");
fprintf(stderr, " [-i[nput] In (NULL )] :Essential :Input: MRC\n");
fprintf(stderr, " [-o[utput] Out (NULL )] :Essential :Output: MRC\n");
- fprintf(stderr, " [-Max[Size] MaxSize (100.0 )] :Optional :Input: [A]\n");
+ fprintf(stderr, " [-R[ing]R[adius] RingRadius (100.0 )] :Optional :Input: [A]\n");
+ fprintf(stderr, " [-R[ing]W[idth] RingWidth (10.0 )] :Optional :Input: [A]\n");
+ fprintf(stderr, " [-thres[hold] Threshold (3.0 )] :Optional :Input: threshold of IQ\n");
+ fprintf(stderr, " [-out[Threshold] outFileThres (stdout )] :Optional :Output: Output\n");
fprintf(stderr, " [-c[onfig] configFile (NULL )] :Optional :ConfigurationFile\n");
fprintf(stderr, " [-m[ode] mode (0 )] :Optional :Mode\n");
additionalUsage();