43 #include "Windows4Root.h"
46 #include "TApplication.h"
63 #define GATE_SYS_UNKNOWN -1
65 #define GATE_SYS_CYLINDRICAL 0
67 #define GATE_SYS_ECAT 1
69 #define GATE_SYS_SPECT 2
73 #define GATE_NB_MAX_LAYERS 4 // Max number of layer in GATE = 4
93 vector<string>
Split(
string a_line);
128 template <
typename T>
129 int WriteVector(ofstream& file,
const string& a_key, vector <T> a_vals);
139 int WriteVector(ofstream& file,
const string& a_key, vector <string> a_vals);
149 int WriteVector(ofstream& file,
const string& a_key, vector <vector<string> > a_vals);
171 int GetGATEMacFiles(
const string& a_pathMac, vector<string> &ap_pathToMacFiles);
195 string& rsector_name,
197 string& submodule_name,
198 string& crystal_name,
199 vector<string>& layers_name ,
220 string& crystal_name,
243 string& crystal_name,
268 int32_t nCrystalsTransaxial,
269 int32_t nCrystalsAxial,
292 uint32_t a_nProjectionsByHead);
333 float_t a_headAngPitch,
334 float_t a_crystalSizeAxl,
335 float_t a_crystalSizeTrs,
384 uint32_t nRsectorsAxial,
385 int a_rsectorIdOrder,
386 uint32_t nModulesTransaxial,
387 uint32_t nModulesAxial,
388 uint32_t nSubmodulesTransaxial,
389 uint32_t nSubmodulesAxial,
390 uint32_t nCrystalsTransaxial,
391 uint32_t nCrystalsAxial,
393 uint32_t* nCrystalPerLayer,
394 vector<uint32_t> nLayersRptTransaxial,
395 vector<uint32_t> nLayersRptAxial,
416 int comptonPhantom1,
int comptonPhantom2,
417 int rayleighPhantom1,
int rayleighPhantom2);
443 uint32_t &nCrystalsTot,
444 uint32_t &nCrystalsAxial,
445 uint32_t &nCrystalsTransaxial,
446 uint32_t &nBlocksLine,
447 uint32_t &nBlocksPerRing,
448 uint32_t &start_time_ms,
449 uint32_t &duration_ms,
490 float_t &distToDetector,
494 float_t &crystalSizeAxl,
495 float_t &crystalSizeTrs,
496 uint32_t &nProjectionsTot,
497 uint32_t &nProjectionsByHead,
498 float_t &head1stAngle,
499 float_t &headAngPitch,
500 float_t &headAngStepDeg,
501 int &headRotDirection,
502 uint32_t &start_time_ms,
503 uint32_t &duration_ms,
546 float_t &ap_distToDetector,
548 uint32_t &ap_nPixAxl,
549 uint32_t &ap_nPixTrs,
550 float_t &ap_crystalSizeAxl,
551 float_t &ap_crystalSizeTrs,
552 uint32_t &ap_nProjectionsTot,
553 uint32_t &ap_nProjectionsByHead,
554 float_t &ap_head1stAngle,
555 float_t &ap_headAngPitch,
556 float_t &headAngStepDeg,
557 int &ap_headRotDirection,
558 uint32_t &ap_start_time_ms,
559 uint32_t &ap_duration_ms,
605 uint32_t *nb_crystal_per_layer,
606 uint32_t &nCrystalsTot,
607 uint32_t &nCrystalsAxial,
608 uint32_t &nCrystalsTransaxial,
609 vector<uint32_t> &nLayersRptAxial,
610 vector<uint32_t> &nLayersRptTransaxial,
611 uint32_t &nSubmodulesAxial,
612 uint32_t &nSubmodulesTransaxial,
613 uint32_t &nModulesAxial,
614 uint32_t &nModulesTransaxial,
615 uint32_t &nRsectorsAxial,
616 uint32_t &nRsectorsAngPos,
617 int &rsector_id_order,
618 uint32_t &start_time_ms,
619 uint32_t &duration_ms,
uint32_t ConvertIDSPECTRoot1(int32_t a_headID, float_t a_rotAngle, float_t a_angStep, uint32_t a_nProjectionsByHead)
Compute a CASToR projection index of a GATE SPECThead system.
void ConvertValuesTomm(vector< string > &values)
Check if the vector of strings passed in parameter contains the 'cm' unit In this case...
This header file is mainly used to declare some macro definitions and all includes needed from the st...
vector< string > CheckGATECommand(const string &a_key, const string &a_line)
Check if the line contains the provided GATE command. In this case, parse the line and returns the va...
int ReadMacSPECT(string a_pathMac, float_t &distToDetector, uint32_t &nHeads, uint32_t &nPixAxl, uint32_t &nPixTrs, float_t &crystalSizeAxl, float_t &crystalSizeTrs, uint32_t &nProjectionsTot, uint32_t &nProjectionsByHead, float_t &head1stAngle, float_t &headAngPitch, float_t &headAngStepDeg, int &headRotDirection, uint32_t &start_time_ms, uint32_t &duration_ms, int vb)
Recover informations about the scanner element of an ECAT system, and acquisition duration...
int GetGATEAliasesSPECT(vector< string > path_mac_files, string &base_name, string &crystal_name, string &pixel_name, int vb)
Loop over a list of path to GATE macro files passed in parameter to recover aliases of the different ...
int GetGATEAliasesEcat(vector< string > path_mac_files, string &block_name, string &crystal_name, int vb)
Loop over a list of path to GATE macro files passed in parameter to recover aliases of the different ...
Declaration of class iDataFilePET.
uint32_t ConvertIDcylindrical(uint32_t nRsectorsAngPos, uint32_t nRsectorsAxial, int a_rsectorIdOrder, uint32_t nModulesTransaxial, uint32_t nModulesAxial, uint32_t nSubmodulesTransaxial, uint32_t nSubmodulesAxial, uint32_t nCrystalsTransaxial, uint32_t nCrystalsAxial, uint8_t nLayers, uint32_t *nCrystalPerLayer, vector< uint32_t > nLayersRptTransaxial, vector< uint32_t > nLayersRptAxial, int32_t layerID, int32_t crystalID, int32_t submoduleID, int32_t moduleID, int32_t rsectorID)
Compute a CASToR crystal index of a GATE cylindricalPET system from its indexes (rsector/module/submo...
int GetGATEAliasesCylindrical(vector< string > path_mac_files, string &rsector_name, string &module_name, string &submodule_name, string &crystal_name, vector< string > &layers_name, int vb)
Loop over a list of path to GATE macro files passed in parameter to recover aliases of the different ...
int ReadMacCylindrical(string a_pathMac, uint8_t &nLayers, uint32_t *nb_crystal_per_layer, uint32_t &nCrystalsTot, uint32_t &nCrystalsAxial, uint32_t &nCrystalsTransaxial, vector< uint32_t > &nLayersRptAxial, vector< uint32_t > &nLayersRptTransaxial, uint32_t &nSubmodulesAxial, uint32_t &nSubmodulesTransaxial, uint32_t &nModulesAxial, uint32_t &nModulesTransaxial, uint32_t &nRsectorsAxial, uint32_t &nRsectorsAngPos, int &rsector_id_order, uint32_t &start_time_ms, uint32_t &duration_ms, int vb)
Recover informations about the scanner element of a cylindricalPET system and acquisition duration...
int ComputeKindGATEEvent(uint32_t eventID1, uint32_t eventID2, int comptonPhantom1, int comptonPhantom2, int rayleighPhantom1, int rayleighPhantom2)
Determine kind of a given coincidence event, from its attributes.
int ReadMacECAT(string a_pathMac, uint32_t &nCrystalsTot, uint32_t &nCrystalsAxial, uint32_t &nCrystalsTransaxial, uint32_t &nBlocksLine, uint32_t &nBlocksPerRing, uint32_t &start_time_ms, uint32_t &duration_ms, int vb)
Recover informations about the scanner element of an ECAT system and acquisition duration, from a GATE macro file.
Declaration of class sScannerManager.
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...
int WriteVector(ofstream &file, const string &a_key, vector< T > a_vals)
Write the key and its values in the file provided in parameter.
string toString(T a_val)
Convert a value of any type into string.
Declaration of class sOutputManager.
int GetGATEMacFiles(const string &a_pathMac, vector< string > &ap_pathToMacFiles)
Extract the paths to each macro file contained in the main macro file.
This file is used for all kind of different functions designed for options parsing and ASCII file rea...
vector< string > Split(string a_line)
Split the line provided in parameter into a vector of strings (separator is blankspace) ...
This group of functions manages Interfile image file format.
uint32_t ConvertIDecat(int32_t nBlocksPerRing, int32_t nBlocksLine, int32_t nCrystalsTransaxial, int32_t nCrystalsAxial, int32_t crystalID, int32_t blockID)
Compute a CASToR crystal index of a GATE ecat system from its indexes (block/crystal) and the system ...
int ReadIntfSPECT(string a_pathIntf, float_t &ap_distToDetector, uint32_t &ap_nHeads, uint32_t &ap_nPixAxl, uint32_t &ap_nPixTrs, float_t &ap_crystalSizeAxl, float_t &ap_crystalSizeTrs, uint32_t &ap_nProjectionsTot, uint32_t &ap_nProjectionsByHead, float_t &ap_head1stAngle, float_t &ap_headAngPitch, float_t &headAngStepDeg, int &ap_headRotDirection, uint32_t &ap_start_time_ms, uint32_t &ap_duration_ms, int vb)
Recover informations about the scanner element of an ECAT system, and acquisition duration...
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...
uint32_t ConvertIDSPECTRoot2(uint32_t a_nbSimulatedPixels, uint32_t a_nPixTrs, uint32_t a_nPixAxl, int32_t a_headID, int32_t a_crystalID, int32_t a_pixelID, float_t a_rotAngle, float_t a_headAngPitch, float_t a_crystalSizeAxl, float_t a_crystalSizeTrs, float_t a_gPosX, float_t a_gPosY, float_t a_gPosZ)
Compute a CASToR crystal index of a GATE SPECThead system.