39 cout <<
" Usage: castor-GATEMacToGeom -m input_mac_file" << endl;
40 cout <<
" -o output_geom_file" << endl;
41 cout <<
" -v verbose" << endl;
43 cout <<
"[Input settings]:" << endl;
44 cout <<
" -m input_mac_file : give the path to a GATE macro file describing a cylindricalPET, ecat or SPECThead system" << endl;
45 cout <<
" -o output_geom_file : give the alias of the output geom file which will be generated in the scanner repository (default location: config/scanner/)" << endl;
49 cout <<
" This program is part of the CASToR release version " <<
CASTOR_VERSION <<
"." << endl;
64 int main(
int argc,
char *argv[])
67 string path_to_mac =
"";
69 string path_to_geom =
"";
73 cerr <<
"Invalid number of arguments. Please read the help section." << endl;
78 for (
int i=1; i<argc; i++)
80 string option = (string)argv[i];
85 if (argv[i+1] == NULL)
87 Cerr(
"***** castor-GATEMacToGeom :: argument missing for option: " << option << endl);
91 path_to_mac = argv[i+1];
94 ifstream fcheck(path_to_mac.c_str());
97 Cerr(
"***** castor-GATEMacToGeom :: cannot read provided mac file : " << path_to_mac << endl);
105 else if (option==
"-o")
107 if (argv[i+1] == NULL)
109 Cerr(
"***** castor-GATEMacToGeom :: argument missing for option: " << option << endl);
113 path_to_geom = argv[i+1];
119 Cerr(endl <<
"***** castor-GATERootToCastor :: Unknown option '" << option <<
"' !" << endl);
136 Cerr(
"***** castor-GATEMacToGeom :: A problem occured while checking for the config directory path !" << endl);
141 path_to_geom = scanner_repository + path_to_geom +
".geom";
143 cout <<
"path mac " << path_to_mac << endl;
150 cout << endl <<
" --- CylindricalPET system detected. Proceeding to conversion... --- " << endl << endl;
154 Cerr(
"***** castor-GATEMacToGeom :: An error occured while trying to process mac file for cylindrical system: " << path_to_mac << endl);
160 cout << endl <<
" --- ECAT system detected. Proceeding to conversion... --- " << endl;
163 Cerr(
"***** castor-GATEMacToGeom :: An error occured while trying to process mac file for ecat system: " << path_to_mac << endl);
169 cout << endl <<
" --- SPECThead system detected. Proceeding to conversion... --- " << endl;
172 Cerr(
"***** castor-GATEMacToGeom :: An error occured while trying to process mac file for SPECT system: " << path_to_mac << endl);
178 Cerr(
"***** castor-GATEMacToGeom :: System type not supported : " << endl);
179 Cerr(
" This script only supports conversion for cylindricalPET ecat and SPECThead systems" << endl);
180 Cerr(
" The system type is recovered from the lines '/gate/systems/...'" << endl);
184 cout << endl <<
" --- Conversion completed --- " << endl << endl;
This file gathers various function dedicated to data conversion in order to convert various type of G...
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
int CheckConfigDir(const string &a_path)
Set the path to the CASTOR config directory from the given path if not empty or through the existence...
int main(int argc, char *argv[])
Singleton class that manages output writing on disk (images, sinograms, etc). It also manages loggi...
const string & GetPathToConfigDir()
Return the path to the CASTOR config directory.
int CreateGeomWithECAT(string a_pathMac, string a_pathGeom)
Read a GATE macro file containing the description of an ecat system, and convert it to a geom file...
#define GATE_SYS_CYLINDRICAL
void showHelp(int a_returnCode)
int GetGATESystemType(const string &a_pathMac)
Read a GATE macro file and identify the system type from the 'gate/systems/' command lines...
int CreateGeomWithCylindrical(string a_pathMac, string a_pathGeom)
Read a GATE macro file containing the description of a cylindricalPET system, and convert it to a geo...
int CreateGeomWithSPECT(string a_pathMac, string a_pathGeom)
Read a GATE macro file containing the description of a SPECThead system, and convert it to a geom fil...