59 cout <<
" Usage: castor-GATEMacToGeom -m input_mac_file" << endl;
60 cout <<
" -o output_geom_file" << endl;
61 cout <<
" -v verbose" << endl;
63 cout <<
"[Input settings]:" << endl;
64 cout <<
" -m input_mac_file : give the path to a GATE macro file describing a cylindricalPET, ecat or SPECThead system" << endl;
65 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;
69 cout <<
" This program is part of the CASToR release version " <<
CASTOR_VERSION <<
"." << endl;
84 int main(
int argc,
char *argv[])
87 string path_to_mac =
"";
89 string path_to_geom =
"";
93 cerr <<
"Invalid number of arguments. Please read the help section." << endl;
98 for (
int i=1; i<argc; i++)
100 string option = (string)argv[i];
105 if (argv[i+1] == NULL)
107 Cerr(
"***** castor-GATEMacToGeom :: argument missing for option: " << option << endl);
111 path_to_mac = argv[i+1];
114 ifstream fcheck(path_to_mac.c_str());
117 Cerr(
"***** castor-GATEMacToGeom :: cannot read provided mac file : " << path_to_mac << endl);
125 else if (option==
"-o")
127 if (argv[i+1] == NULL)
129 Cerr(
"***** castor-GATEMacToGeom :: argument missing for option: " << option << endl);
133 path_to_geom = argv[i+1];
139 Cerr(endl <<
"***** castor-GATERootToCastor :: Unknown option '" << option <<
"' !" << endl);
156 Cerr(
"***** castor-GATEMacToGeom :: A problem occured while checking for the config directory path !" << endl);
161 path_to_geom = scanner_repository + path_to_geom +
".geom";
163 cout <<
"path mac " << path_to_mac << endl;
170 cout << endl <<
" --- CylindricalPET system detected. Proceeding to conversion... --- " << endl << endl;
174 Cerr(
"***** castor-GATEMacToGeom :: An error occured while trying to process mac file for cylindrical system: " << path_to_mac << endl);
180 cout << endl <<
" --- ECAT system detected. Proceeding to conversion... --- " << endl;
183 Cerr(
"***** castor-GATEMacToGeom :: An error occured while trying to process mac file for ecat system: " << path_to_mac << endl);
189 cout << endl <<
" --- SPECThead system detected. Proceeding to conversion... --- " << endl;
192 Cerr(
"***** castor-GATEMacToGeom :: An error occured while trying to process mac file for SPECT system: " << path_to_mac << endl);
198 Cerr(
"***** castor-GATEMacToGeom :: System type not supported : " << endl);
199 Cerr(
" This script only supports conversion for cylindricalPET ecat and SPECThead systems" << endl);
200 Cerr(
" The system type is recovered from the lines '/gate/systems/...'" << endl);
204 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...