int flagInImage;
mrcImage* inImage;
Array X;
+ Array Ave;
Array C;
Array u;
Array lambda;
long flagrmax;
double RMS; /* Root mean square */
int mode;
+
+ /* For Search Area */
+ int flagXrange;
+ int flagYrange;
+ int flagZrange;
+ double XrangeMin;
+ double XrangeMax;
+ double YrangeMin;
+ double YrangeMax;
+ double ZrangeMin;
+ double ZrangeMax;
+
+ int flagCentre;
+ double CentreX;
+ double CentreY;
+ double CentreZ;
} mrcImageInformation;
/* struct end */
</HEAD>
<BODY>
<H1> mrcImage </H1>
-<H4> Update Time 06/24/13---09:37:26 </H4>
+<H4> Update Time 06/24/13---21:41:38 </H4>
<H2> Concept </H2>
<A HREF="#include">mrcImage.h</A>
<H2> Data Structure </H2>
long flagrmax;
double RMS; /* Root mean square */
int mode;
+
+ /* For Search Area */
+ int flagXrange;
+ int flagYrange;
+ int flagZrange;
+ double XrangeMin;
+ double XrangeMax;
+ double YrangeMin;
+ double YrangeMax;
+ double ZrangeMin;
+ double ZrangeMax;
+
+ int flagCentre;
+ double CentreX;
+ double CentreY;
+ double CentreZ;
} mrcImageInformation;
/* struct end */
long flagrmax;
double RMS; /* Root mean square */
int mode;
+
+ /* For Search Area */
+ int flagXrange;
+ int flagYrange;
+ int flagZrange;
+ double XrangeMin;
+ double XrangeMax;
+ double YrangeMin;
+ double YrangeMax;
+ double ZrangeMin;
+ double ZrangeMax;
+
+ int flagCentre;
+ double CentreX;
+ double CentreY;
+ double CentreZ;
} mrcImageInformation;
/* struct end */
int flagInImage;
mrcImage* inImage;
Array X;
+ Array Ave;
Array C;
Array u;
Array lambda;
double data, data1, data2;
char s[256];
mrcImage temp;
-
y = in.inImage->HeaderN.y;
in.X.dim = 2;
in.X.n[0] = in.inImage->HeaderN.x;
in.X.n[1] = y * in.inImage->HeaderN.z;
arrayInit(&(in.X), "X in lmrcSinogramFETPCA");
+ in.Ave.dim = 2;
+ in.Ave.n[0] = in.inImage->HeaderN.x;
+ in.Ave.n[1] = y * in.inImage->HeaderN.z;
+ arrayInit(&(in.Ave), "Ave in lmrcSinogramFETPCA");
for(k=0; k<in.inImage->HeaderN.z; k++){
for(j=0; j<in.inImage->HeaderN.y; j++){
}
}
//fprintf(stderr,"before arrayPCA\n");
- arrayPCA(&(in.u), &(in.C), &(in.lambda), &(in.X), 0);
+ arrayPCA(&(in.u), &(in.C), &(in.lambda), &(in.X), &(in.Ave), 0);
//fprintf(stderr,"after arrayPCA\n");
//arrayWriteToFile(in.Out, &(in.X), "in main");
int cy;
int cz;
int count;
+ int xmin, ymin, zmin;
+ int xmax, ymax, zmax;
DEBUGPRINT("meanOfAll\n");
-
- cx = img->HeaderN.x/2;
- cy = img->HeaderN.y/2;
- cz = img->HeaderN.z/2;
+
+ if(info->flagCentre) {
+ cx = info->CentreX;
+ cy = info->CentreY;
+ cz = info->CentreZ;
+ } else {
+ cx = img->HeaderN.x/2;
+ cy = img->HeaderN.y/2;
+ cz = img->HeaderN.z/2;
+ }
mrcPixelDataGet(img,
(mrcImageParaTypeReal)cx,
(mrcImageParaTypeReal)cy,
info->maxCoord.y = cy;
info->maxCoord.z = cz;
sumForMean = sumForSd = 0;
+
+ if(info->flagXrange) {
+ xmin = info->XrangeMin;
+ xmax = info->XrangeMax;
+ } else {
+ xmin = -32;
+ xmax = +32;
+ }
+
+ if(info->flagYrange) {
+ ymin = info->YrangeMin;
+ ymax = info->YrangeMax;
+ } else {
+ ymin = -32;
+ ymax = +32;
+ }
+
+ if(info->flagZrange) {
+ zmin = info->ZrangeMin;
+ zmax = info->ZrangeMax;
+ } else {
+ zmin = -32;
+ zmax = +32;
+ }
+
count=0;
- for(iz=MAX(0,cz-32); iz<MIN(cz+32,img->HeaderN.z); iz++) {
- for(iy=MAX(0,cy-32); iy<MIN(cy+32,img->HeaderN.y); iy++) {
- for(ix=MAX(0,cx-32); ix<MIN(cx+32,img->HeaderN.x); ix++) {
+ for(iz=cz+zmin; iz<cz+zmax; iz++) {
+ for(iy=cy+ymin; iy<cy+ymax; iy++) {
+ for(ix=cx+xmin; ix<cx+xmax; ix++) {
count++;
mrcPixelDataGet(img, (mrcImageParaTypeReal)ix, (mrcImageParaTypeReal)iy, (mrcImageParaTypeReal)iz,
&data, mrcPixelMag, mrcPixelHowNearest);
WORLDNAME=Tools
WORLDNAME=Tools
WORLDNAME=Tools
+WORLDNAME=Tools
"-Rot1","-Rot1","Rot1","Optional","3","1","Rot1Min","Real","0.0","2","Rot1Max","Real","360.0","3","Rot1Delta","Real","5.0"
"-Rot2","-Rot2","Rot2","Optional","3","1","Rot2Min","Real","0.0","2","Rot2Max","Real","180.0","3","Rot2Delta","Real","5.0"
"-Rot3","-Rot3","Rot3","Optional","3","1","Rot3Min","Real","0.0","2","Rot3Max","Real","360.0","3","Rot3Delta","Real","5.0"
+"-Xrange","-Xrange","Xrange[pixel]: Not set, all space search","Optional","2","1","XrangeMin","Real","0","2","XrangeMax","Real","0"
+"-Yrange","-Yrange","Yrange[pixel]: Not set, all space search","Optional","2","1","YrangeMin","Real","0","2","YrangeMax","Real","0"
+"-Zrange","-Zrange","Zrange[pixel]: Not set, all space search","Optional","2","1","ZrangeMin","Real","0","2","ZrangeMax","Real","0"
"-M","-M[ode]","Mode: Correlation Mode","Optional","1","1","Mode","Integer","0"
"-MR","-M[ode]R[otation]","Mode: Rotation3D Mode","Optional","1","1","ModeRotation","Integer","0"
"-c","-c[onfig]","ConfigurationFile","Optional","1","1","configFile","inFile","NULL"
long flagRot3Delta;
float Rot3Delta;
+ long flagXrangeMin;
+ float XrangeMin;
+
+ long flagXrangeMax;
+ float XrangeMax;
+
+ long flagYrangeMin;
+ float YrangeMin;
+
+ long flagYrangeMax;
+ float YrangeMax;
+
+ long flagZrangeMin;
+ float ZrangeMin;
+
+ long flagZrangeMax;
+ float ZrangeMax;
+
long flagMode;
long Mode;
}
SBREAK;
}
+ SCASE("Xrange") {
+ if(i+2<argc) {
+ info->XrangeMin = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagXrangeMin++;
+ info->XrangeMax = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagXrangeMax++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("Yrange") {
+ if(i+2<argc) {
+ info->YrangeMin = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagYrangeMin++;
+ info->YrangeMax = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagYrangeMax++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("Zrange") {
+ if(i+2<argc) {
+ info->ZrangeMin = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagZrangeMin++;
+ info->ZrangeMax = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagZrangeMax++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
SCASE("M") {
if(i+1<argc) {
info->Mode = stringGetNthIntegerData(argv[i+1], 1, " ,");
info->Rot3Min = 0.0; info->flagRot3Min = 0;
info->Rot3Max = 360.0; info->flagRot3Max = 0;
info->Rot3Delta = 5.0; info->flagRot3Delta = 0;
+ info->XrangeMin = 0; info->flagXrangeMin = 0;
+ info->XrangeMax = 0; info->flagXrangeMax = 0;
+ info->YrangeMin = 0; info->flagYrangeMin = 0;
+ info->YrangeMax = 0; info->flagYrangeMax = 0;
+ info->ZrangeMin = 0; info->flagZrangeMin = 0;
+ info->ZrangeMax = 0; info->flagZrangeMax = 0;
info->Mode = 0; info->flagMode = 0;
info->ModeRotation = 0; info->flagModeRotation = 0;
info->fptconfigFile = NULL; info->flagconfigFile = 0;
if(info->flagRot3Delta) {
}
+ if(info->flagXrangeMin) {
+ }
+
+ if(info->flagXrangeMax) {
+ }
+
+ if(info->flagYrangeMin) {
+ }
+
+ if(info->flagYrangeMax) {
+ }
+
+ if(info->flagZrangeMin) {
+ }
+
+ if(info->flagZrangeMax) {
+ }
+
if(info->flagMode) {
}
lmrcImageAutoRotationCorrelation3DRange Rot3;
char* EulerAngle;
+ int flagXrange;
+ int flagYrange;
+ int flagZrange;
+ lmrcImageAutoRotationCorrelation3DRange Xrange;
+ lmrcImageAutoRotationCorrelation3DRange Yrange;
+ lmrcImageAutoRotationCorrelation3DRange Zrange;
+
long CorrelationMode;
mrcImage CorMap;
mrcImage LinearCorMap;
linfo.CorrelationMode = info.Mode;
linfo.RotationMode = info.ModeRotation;
+ linfo.flagXrange = info.flagXrangeMin;
+ linfo.flagYrange = info.flagYrangeMin;
+ linfo.flagZrange = info.flagZrangeMin;
+
+ linfo.Xrange.Min = info.XrangeMin;
+ linfo.Xrange.Max = info.XrangeMax;
+ linfo.Yrange.Min = info.YrangeMin;
+ linfo.Yrange.Max = info.YrangeMax;
+ linfo.Zrange.Min = info.ZrangeMin;
+ linfo.Zrange.Max = info.ZrangeMax;
+
mrcFileRead(&in, info.In, "in main", 0);
mrcFileRead(&ref, info.Ref, "in main", 0);
mrcImageInformation info;
double max=-1;
- info.mode = meanOfAll;
-
+
+ if(info.flagXrange || info.flagYrange || info.flagZrange) {
+ info.mode = meanOfCentre;
+
+ info.flagXrange = linfo->flagXrange;
+ info.XrangeMin = linfo->Xrange.Min;
+ info.XrangeMax = linfo->Xrange.Max;
+ info.flagYrange = linfo->flagYrange;
+ info.YrangeMin = linfo->Yrange.Min;
+ info.YrangeMax = linfo->Yrange.Max;
+ info.flagZrange = linfo->flagZrange;
+ info.ZrangeMin = linfo->Zrange.Min;
+ info.ZrangeMax = linfo->Zrange.Max;
+
+ info.flagCentre = 1;
+ info.CentreX = 0;
+ info.CentreY = 0;
+ info.CentreZ = 0;
+ } else {
+ info.mode = meanOfAll;
+ }
+
DEBUGPRINT3("%d %d %d N for Rotation\n", linfo->Rot1.N, linfo->Rot2.N, linfo->Rot3.N);
DEBUGPRINT3("Rot1 %f %f %f \n", linfo->Rot1.Min, linfo->Rot1.Max, linfo->Rot1.Delta);
DEBUGPRINT3("Rot2 %f %f %f \n", linfo->Rot2.Min, linfo->Rot2.Max, linfo->Rot2.Delta);
[-Rot1 Rot1Min (0.0 )Rot1Max (360.0 )Rot1Delta (5.0 )] :Optional :Rot1
[-Rot2 Rot2Min (0.0 )Rot2Max (180.0 )Rot2Delta (5.0 )] :Optional :Rot2
[-Rot3 Rot3Min (0.0 )Rot3Max (360.0 )Rot3Delta (5.0 )] :Optional :Rot3
+ [-Xrange XrangeMin (0 )XrangeMax (0 )] :Optional :Xrange[pixel]: Not set, all space search
+ [-Yrange YrangeMin (0 )YrangeMax (0 )] :Optional :Yrange[pixel]: Not set, all space search
+ [-Zrange ZrangeMin (0 )ZrangeMax (0 )] :Optional :Zrange[pixel]: Not set, all space search
[-M[ode] Mode (0 )] :Optional :Mode: Correlation Mode
[-M[ode]R[otation] ModeRotation (0 )] :Optional :Mode: Rotation3D Mode
[-c[onfig] configFile (NULL )] :Optional :ConfigurationFile
-I 1 0 0 1 0 1 -1x1+1+10 ' ' '0.0' 'Rot1Min' Rot1
-I 1 0 0 1 0 1 -1x1+1+12 ' ' '0.0' 'Rot2Min' Rot2
-I 1 0 0 1 0 1 -1x1+1+13 ' ' '0.0' 'Rot3Min' Rot3
- -i 1 0 1 0 0 -1x1+1+15.000000 0 0 0 0 0 'Mode' 'Mode: Correlation Mode' M
- -i 1 0 1 0 0 -1x1+1+16.500000 0 0 0 0 0 'ModeRotation' 'Mode: Rotation3D Mode' MR
- -I 1 0 1 0 0 1 -1x1+1+18.000000 ' ' 'configFile' 'ConfigurationFile' c
- -i 1 0 1 0 0 -1x1+1+19.500000 0 0 0 0 0 'mode' 'Mode: InterpolationMode' m
+ -I 1 0 0 1 0 1 -1x1+1+15 ' ' '0' 'XrangeMin' Xrange[pixel]: Not set, all space search
+ -I 1 0 0 1 0 1 -1x1+1+16 ' ' '0' 'YrangeMin' Yrange[pixel]: Not set, all space search
+ -I 1 0 0 1 0 1 -1x1+1+18 ' ' '0' 'ZrangeMin' Zrange[pixel]: Not set, all space search
+ -i 1 0 1 0 0 -1x1+1+19.500000 0 0 0 0 0 'Mode' 'Mode: Correlation Mode' M
+ -i 1 0 1 0 0 -1x1+1+21.000000 0 0 0 0 0 'ModeRotation' 'Mode: Rotation3D Mode' MR
+ -I 1 0 1 0 0 1 -1x1+1+22.500000 ' ' 'configFile' 'ConfigurationFile' c
+ -i 1 0 1 0 0 -1x1+1+24.000000 0 0 0 0 0 'mode' 'Mode: InterpolationMode' m
-E
-E
-E
fprintf(stderr, " [-Rot1 Rot1Min (0.0 )Rot1Max (360.0 )Rot1Delta (5.0 )] :Optional :Rot1\n");
fprintf(stderr, " [-Rot2 Rot2Min (0.0 )Rot2Max (180.0 )Rot2Delta (5.0 )] :Optional :Rot2\n");
fprintf(stderr, " [-Rot3 Rot3Min (0.0 )Rot3Max (360.0 )Rot3Delta (5.0 )] :Optional :Rot3\n");
+ fprintf(stderr, " [-Xrange XrangeMin (0 )XrangeMax (0 )] :Optional :Xrange[pixel]: Not set, all space search\n");
+ fprintf(stderr, " [-Yrange YrangeMin (0 )YrangeMax (0 )] :Optional :Yrange[pixel]: Not set, all space search\n");
+ fprintf(stderr, " [-Zrange ZrangeMin (0 )ZrangeMax (0 )] :Optional :Zrange[pixel]: Not set, all space search\n");
fprintf(stderr, " [-M[ode] Mode (0 )] :Optional :Mode: Correlation Mode\n");
fprintf(stderr, " [-M[ode]R[otation] ModeRotation (0 )] :Optional :Mode: Rotation3D Mode\n");
fprintf(stderr, " [-c[onfig] configFile (NULL )] :Optional :ConfigurationFile\n");