66 char rwcname[256]=
"\0", edbname[256]=
"\0", mapname[256]=
"\0", grsname[256]=
"\0";
67 char options[256]=
"\0";
68 bool addmap(
false),addgrs(
false);
70 bool printusage=(argc<3)?
true:
false;
71 for (
int i = 1; i < argc; i++) {
72 if (!strcmp(argv[i],
"-map")) {
73 if (i + 1 <= argc - 1) { sprintf(mapname,argv[++i]); addmap=
true; }
76 else if (!strcmp(argv[i],
"-grs")) {
77 if (i + 1 <= argc - 1) { sprintf(grsname,argv[++i]); addgrs=
true; }
80 else if (!strcmp(argv[i],
"-nocl")) strcat(options,
"NOCL") ;
81 else if (!strcmp(argv[i],
"-asum")) strcat(options,
"SUM") ;
82 else if (!strcmp(argv[i],
"-clframe")) strcat(options,
"CLFRAME") ;
84 sprintf(rwcname,argv[i++]);
85 sprintf(edbname,argv[i]);
89 cout<<
"usage: rwc2edb <input file (.rwc|.rwd|.txt)> <output file (.root)> [options] "<<endl;
90 cout <<
"\n options: -nocl = do not add the clusters" << endl;
91 cout <<
" -clframe = fill clusters.eFrame (default empty) -> +4% file size" << endl;
92 cout <<
" -map filename = add the fiducial marks file (.map) (only mswindows)" << endl;
93 cout <<
" -grs filename = merge raw data (.rwd) and grains (.txt) " << endl;
94 cout <<
" (if only grains: rwc2edb fname.txt fname.root)" << endl;
95 cout <<
" -asum = encode the sum of cluster areas in the segment puls" << endl;
96 cout <<
" (puls = (sum of clust areas)*1000 + (number of grains)" << endl;
100 bool testrun =
false;
101 bool txtrun = false ;
102 if(rwcname[strlen(rwcname)-1]==
'd') testrun=
true;
103 if(rwcname[strlen(rwcname)-1]==
't') txtrun =
true;
106 outrun =
new EdbRun(edbname,
"CREATE");
111 cout<<
"TestRun"<<endl;
113 AddRWD(outrun, rwcname, fragID, options);
117 char grsoutname[256];
118 strncpy( grsoutname + strlen(rwcname)-3,
"grs", 3);
119 sprintf( grsoutname,
"%s.root",grsoutname);
122 outrun2 =
new EdbRun(grsoutname,
"CREATE");
137 printf(
"options 1: %s\n", options);
138 AddRWC(outrun, rwcname,
true,options);
139 if (addmap)
AddMAP(outrun, mapname);
144 if (testrun)
return 0;
void Close()
Definition: EdbRun.cxx:466
void Print() const
Definition: EdbRun.cxx:607
int AddGrainsTXT(EdbRun *run, char *txtname)
Definition: libDataConversion.cpp:340
int AddMAP(EdbRun *run, char *mapname)
Definition: libDataConversion.cpp:311
int AddRWD(EdbRun *run, char *rwdname, int fragID, const char *options)
Definition: libDataConversion.cpp:176
int AddRWC(EdbRun *run, char *rwcname, int bAddRWD, const char *options)
Definition: libDataConversion.cpp:64