--- /dev/null
+../sbin/MachineIndependent
\ No newline at end of file
/* constant begin */
typedef enum lmrc2bildMode {
- lmrc2bildModeArrows=0
+ lmrc2bildModeArrows=0,
+ lmrc2bildModeSpheres=1
} lmrc2bildMode;
/* prototype begin */
+extern void lmrc2bildUsage(FILE* fpt);
extern void lmrc2bild(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode);
extern void lmrc2bildArrows(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode);
+extern void lmrc2bildSpheres(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode);
/* prototype end */
/* constant begin */
typedef enum lmrc2bildMode {
- lmrc2bildModeArrows=0
+ lmrc2bildModeArrows=0,
+ lmrc2bildModeSpheres=1
} lmrc2bildMode;
/* prototype begin */
+extern void lmrc2bildUsage(FILE* fpt);
extern void lmrc2bild(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode);
extern void lmrc2bildArrows(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode);
+extern void lmrc2bildSpheres(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode);
/* prototype end */
/* constant begin */
typedef enum lmrc2bildMode {
- lmrc2bildModeArrows=0
+ lmrc2bildModeArrows=0,
+ lmrc2bildModeSpheres=1
} lmrc2bildMode;
/* prototype begin */
+extern void lmrc2bildUsage(FILE* fpt);
extern void lmrc2bild(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode);
extern void lmrc2bildArrows(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode);
+extern void lmrc2bildSpheres(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode);
/* prototype end */
lmrc2bildUsage(FILE* fpt)
{
fprintf(fpt, "%d: Arrows\n", lmrc2bildModeArrows);
-
+ fprintf(fpt, "%d: Spheres\n", lmrc2bildModeSpheres);
}
void
lmrc2bildArrows(fpt, in, linfo, mode);
break;
}
+ case lmrc2bildModeSpheres: {
+ lmrc2bildSpheres(fpt, in, linfo, mode);
+ break;
+ }
}
}
mrcImageParaTypeReal endx, endy, endz;
double d0, d1, d2;
- fprintf(fpt, ".color %g %g %g", linfo.color[0], linfo.color[1], linfo.color[2]);
+ fprintf(fpt, ".color %g %g %g\n", linfo.color[0], linfo.color[1], linfo.color[2]);
for(z=0; z<in[0].HeaderN.z; z++) {
for(y=0; y<in[0].HeaderN.y; y++) {
for(x=0; x<in[0].HeaderN.x; x++) {
mrcPixelDataGet(&in[0], x, y, z, &d0, mrcPixelRePart, mrcPixelHowNearest);
mrcPixelDataGet(&in[1], x, y, z, &d1, mrcPixelRePart, mrcPixelHowNearest);
mrcPixelDataGet(&in[2], x, y, z, &d2, mrcPixelRePart, mrcPixelHowNearest);
- if(d0==0 && d1==1 && d2==0) {
+ if(d0==0 && d1==0 && d2==0) {
} else {
startx = (x+in[0].HeaderStartN.x)*in[0].HeaderLength.x;
starty = (y+in[0].HeaderStartN.y)*in[0].HeaderLength.y;
}
}
}
+
+
+void
+lmrc2bildSpheres(FILE* fpt, mrcImage* in, lmrc2bildInfo linfo, int mode)
+{
+ mrcImageParaTypeReal x, y, z;
+ mrcImageParaTypeReal startx, starty, startz;
+ mrcImageParaTypeReal endx, endy, endz;
+ double d0, d1, d2;
+
+ fprintf(fpt, ".color %g %g %g\n", linfo.color[0], linfo.color[1], linfo.color[2]);
+ for(z=0; z<in[0].HeaderN.z; z++) {
+ for(y=0; y<in[0].HeaderN.y; y++) {
+ for(x=0; x<in[0].HeaderN.x; x++) {
+ mrcPixelDataGet(&in[0], x, y, z, &d0, mrcPixelRePart, mrcPixelHowNearest);
+ if(d0==0 && d1==0 && d2==0) {
+ } else {
+ startx = (x+in[0].HeaderStartN.x)*in[0].HeaderLength.x;
+ starty = (y+in[0].HeaderStartN.y)*in[0].HeaderLength.y;
+ startz = (z+in[0].HeaderStartN.z)*in[0].HeaderLength.z;
+ fprintf(fpt, ".sphere %g %g %g %g\n", startx
+ , starty
+ , startz
+ ,d0*in[0].HeaderLength.x*linfo.zoom);
+ }
+ }
+ }
+ }
+}
+
+
WORLDNAME=Tools
WORLDNAME=Tools
WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
# OptionControlFile
# FileFormat
-"-i","-i[nput]","Input:mrcImagex3","Essential","3","1","In0","inFile::mrcImage","NULL","2","In1","inFile::mrcImage","NULL","3","In2","inFile::mrcImage","NULL"
+"-i","-i[nput]","Input:mrcImagex3","Optional","1","1","In","inFile::mrcImage","NULL"
+"-i3","-i[nput]3","Input:mrcImagex3","Optional","3","1","In0","inFile::mrcImage","NULL","2","In1","inFile::mrcImage","NULL","3","In2","inFile::mrcImage","NULL"
"-o","-o[utput]","OutputDataFile","Essential","1","1","Out","outFile::BILD","stdout"
+"-color","-color","Color","Optional","3","1","Red","Real","1.0","2","Green","Real","1.0","3","Blue","Real","1.0"
+"-zoom","-zoom","Zoom","Optional","1","1","Zoom","Real","1.0"
+"-arrow","-arrow[Shape]","Arrow","Optional","3","1","R1","Real","0.1","2","R2","Real","0.4","3","Rho","Real","0.75"
"-c","-c[onfig]","ConfigurationFile","Optional","1","1","configFile","inFile","NULL"
"-m","-m[ode]","Mode","Optional","1","1","mode","Integer","0"
typedef struct mrc2bildInfo {
long flagRedirect;
+ long flagIn;
+ char* In;
+ FILE* fptIn;
+
long flagIn0;
char* In0;
FILE* fptIn0;
char* Out;
FILE* fptOut;
+ long flagRed;
+ float Red;
+
+ long flagGreen;
+ float Green;
+
+ long flagBlue;
+ float Blue;
+
+ long flagZoom;
+ float Zoom;
+
+ long flagR1;
+ float R1;
+
+ long flagR2;
+ float R2;
+
+ long flagRho;
+ float Rho;
+
long flagconfigFile;
char* configFile;
FILE* fptconfigFile;
if(OPTION_FLAG==argv[i][OPTION_FLAG_POS]) {
SSWITCH(argv[i]+OPTION_POS)
SCASE("i") {
+ if(i+1<argc) {
+ info->In = stringGetNthWord(argv[i+1], 1, " ,");
+ i++;
+ info->flagIn++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("i3") {
if(i+3<argc) {
info->In0 = stringGetNthWord(argv[i+1], 1, " ,");
i++;
}
SBREAK;
}
+ SCASE("color") {
+ if(i+3<argc) {
+ info->Red = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagRed++;
+ info->Green = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagGreen++;
+ info->Blue = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagBlue++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("zoom") {
+ if(i+1<argc) {
+ info->Zoom = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagZoom++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("arrow") {
+ if(i+3<argc) {
+ info->R1 = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagR1++;
+ info->R2 = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagR2++;
+ info->Rho = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagRho++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
SCASE("c") {
if(i+1<argc) {
info->configFile = stringGetNthWord(argv[i+1], 1, " ,");
void
init0(mrc2bildInfo* info)
{
+ info->fptIn = NULL; info->flagIn = 0;
info->fptIn0 = NULL; info->flagIn0 = 0;
info->fptIn1 = NULL; info->flagIn1 = 0;
info->fptIn2 = NULL; info->flagIn2 = 0;
info->fptOut = stdout; info->flagOut = 0;
+ info->Red = 1.0; info->flagRed = 0;
+ info->Green = 1.0; info->flagGreen = 0;
+ info->Blue = 1.0; info->flagBlue = 0;
+ info->Zoom = 1.0; info->flagZoom = 0;
+ info->R1 = 0.1; info->flagR1 = 0;
+ info->R2 = 0.4; info->flagR2 = 0;
+ info->Rho = 0.75; info->flagRho = 0;
info->fptconfigFile = NULL; info->flagconfigFile = 0;
info->mode = 0; info->flagmode = 0;
}
{
char s[1024];
int i;
- if(!info->flagIn0) {
- stringGetFromFile(s, "In0", stdin, stdout, 0);
- info->In0 = stringGetNthWord(s, 1, " ,\t");
- info->flagIn0++;
+ if(info->flagIn) {
+ info->fptIn = fileOpen(info->In, "r");
}
+
if(info->flagIn0) {
info->fptIn0 = fileOpen(info->In0, "r");
}
- if(!info->flagIn1) {
- stringGetFromFile(s, "In1", stdin, stdout, 0);
- info->In1 = stringGetNthWord(s, 1, " ,\t");
- info->flagIn1++;
- }
if(info->flagIn1) {
info->fptIn1 = fileOpen(info->In1, "r");
}
- if(!info->flagIn2) {
- stringGetFromFile(s, "In2", stdin, stdout, 0);
- info->In2 = stringGetNthWord(s, 1, " ,\t");
- info->flagIn2++;
- }
if(info->flagIn2) {
info->fptIn2 = fileOpen(info->In2, "r");
}
info->fptOut = fileOpen(info->Out, "w");
}
+ if(info->flagRed) {
+ }
+
+ if(info->flagGreen) {
+ }
+
+ if(info->flagBlue) {
+ }
+
+ if(info->flagZoom) {
+ }
+
+ if(info->flagR1) {
+ }
+
+ if(info->flagR2) {
+ }
+
+ if(info->flagRho) {
+ }
+
if(info->flagconfigFile) {
info->fptconfigFile = fileOpen(info->configFile, "r");
}
DEBUGPRINT("Program Start\n");
- mrcFileRead(&in[0], info.In0, "in main", 0);
- mrcFileRead(&in[1], info.In1, "in main", 0);
- mrcFileRead(&in[2], info.In2, "in main", 0);
+ switch(info.mode) {
+ case lmrc2bildModeArrows: {
+ if(info.flagIn0) {
+ mrcFileRead(&in[0], info.In0, "in main", 0);
+ mrcFileRead(&in[1], info.In1, "in main", 0);
+ mrcFileRead(&in[2], info.In2, "in main", 0);
+ } else {
+ fprintf(stderr, "need -i3\n");
+ usage(argv[0]);
+ }
+ break;
+ }
+ case lmrc2bildModeSpheres: {
+ if(info.flagIn) {
+ mrcFileRead(&in[0], info.In, "in main", 0);
+ } else {
+ fprintf(stderr, "need -i\n");
+ usage(argv[0]);
+ }
+ break;
+ }
+ default: {
+ fprintf(stderr, "Not supported mode: %ld\n", info.mode);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ linfo.color[0] = info.Red;
+ linfo.color[1] = info.Green;
+ linfo.color[2] = info.Blue;
+ linfo.zoom = info.Zoom;
+ linfo.r1 = info.R1;
+ linfo.r2 = info.R2;
+ linfo.rho = info.Rho;
lmrc2bild(info.fptOut, in, linfo, info.mode);
additionalUsage()
{
fprintf(stderr, "----- Additional Usage -----\n");
+ lmrc2bildUsage(stderr);
}
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>mrc2bild</TITLE>
+</HEAD>
+<BODY>
+<H1>mrc2bild</H1>
+<H2>Usage</H2>
+<PRE>
+Usage: mrc2bild
+Options:
+ [-i[nput] In (NULL ).as(inFile::mrcImage ) ] :Optional :Input:mrcImagex3
+ [-i[nput]3 In0 (NULL ).as(inFile::mrcImage )
+ In1 (NULL ).as(inFile::mrcImage )
+ In2 (NULL ).as(inFile::mrcImage ) ] :Optional :Input:mrcImagex3
+ [-o[utput] Out (stdout ).as(outFile::BILD ) ] :Essential :OutputDataFile
+ [-color Red (1.0 ).as(Real )
+ Green (1.0 ).as(Real )
+ Blue (1.0 ).as(Real ) ] :Optional :Color
+ [-zoom Zoom (1.0 ).as(Real ) ] :Optional :Zoom
+ [-arrow[Shape] R1 (0.1 ).as(Real )
+ R2 (0.4 ).as(Real )
+ Rho (0.75 ).as(Real ) ] :Optional :Arrow
+ [-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile
+ [-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode
+----- Additional Usage -----
+0: Arrows
+1: Spheres
+</PRE>
+</BODY>
+</HTML>
-R 1 0 1 5x1+35+0 'Run' 'execute operation' $EOS/bin/mrc2bild
-H 1 5x1+41+0 'Help' 'help page' $EOS/src/Tools/filter/mrc2bild/doc/mrc2bild.doc help
-Q 1 0 5.25x1+47+0 'Close'
- -I 1 0 1 1 0 1 -1x1+1+1 ' ' 'NULL' 'In0' Input:mrcImagex3
- -O 1 0 1 1 0 1 -1x1+1+3.000000 ' ' 'Out' 'OutputDataFile' o
- -I 1 0 1 0 0 1 -1x1+1+4.500000 ' ' 'configFile' 'ConfigurationFile' c
- -i 1 0 1 0 0 -1x1+1+6.000000 0 0 0 0 0 'mode' 'Mode' m
+ -I 1 0 1 0 0 1 -1x1+1+1.500000 ' ' 'In' 'Input:mrcImagex3' i
+ -I 1 0 0 1 0 1 -1x1+1+3 ' ' 'NULL' 'In0' Input:mrcImagex3
+ -O 1 0 1 1 0 1 -1x1+1+4.500000 ' ' 'Out' 'OutputDataFile' o
+ -I 1 0 0 1 0 1 -1x1+1+6 ' ' '1.0' 'Red' Color
+ -f 1 0 1 0 0 -1x1+1+7.500000 0 0 1.000000 0 0 0 'Zoom' 'Zoom' zoom
+ -I 1 0 0 1 0 1 -1x1+1+9 ' ' '0.1' 'R1' Arrow
+ -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
--- /dev/null
+include ../../Config/Define.inc
+include ../../../Config/Define.inc
+include ../../../../Config/Define.inc
+include ../../../../../Config/Define.inc
+
+all: help exec
+
+help:
+ @echo "----- Help Message Check -----"
+ @../$(OSTYPE)/$(OBJECTNAME) -h
+
+exec:
+ @echo "----- Execution Check -----"
+ ../$(OSTYPE)/$(OBJECTNAME) -i3 data/test.mrc3d data/test.mrc3d data/test.mrc3d -o data/test-arrow.bild -zoom 0.01
+ ../$(OSTYPE)/$(OBJECTNAME) -i data/test.mrc3d -o data/test-sphere.bild -zoom 0.01 -m 1
+ @echo "----- Calc check -----"
+
+clean:
--- /dev/null
+../../../../../..//data/mrc2bild
\ No newline at end of file
{
fprintf(stderr, "Usage: %s\n", thisProgram);
fprintf(stderr, "Options:\n");
- fprintf(stderr, " [-i[nput] In0 (NULL ).as(inFile::mrcImage ) \n In1 (NULL ).as(inFile::mrcImage ) \n In2 (NULL ).as(inFile::mrcImage ) ] :Essential :Input:mrcImagex3\n");
+ fprintf(stderr, " [-i[nput] In (NULL ).as(inFile::mrcImage ) ] :Optional :Input:mrcImagex3\n");
+ fprintf(stderr, " [-i[nput]3 In0 (NULL ).as(inFile::mrcImage ) \n In1 (NULL ).as(inFile::mrcImage ) \n In2 (NULL ).as(inFile::mrcImage ) ] :Optional :Input:mrcImagex3\n");
fprintf(stderr, " [-o[utput] Out (stdout ).as(outFile::BILD ) ] :Essential :OutputDataFile\n");
+ fprintf(stderr, " [-color Red (1.0 ).as(Real ) \n Green (1.0 ).as(Real ) \n Blue (1.0 ).as(Real ) ] :Optional :Color\n");
+ fprintf(stderr, " [-zoom Zoom (1.0 ).as(Real ) ] :Optional :Zoom\n");
+ fprintf(stderr, " [-arrow[Shape] R1 (0.1 ).as(Real ) \n R2 (0.4 ).as(Real ) \n Rho (0.75 ).as(Real ) ] :Optional :Arrow\n");
fprintf(stderr, " [-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile\n");
fprintf(stderr, " [-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode\n");
additionalUsage();