castor-GATERootToCastor for SPECT data

Dear CASToR Users and Developers,

I’m going to convert .root data of a simulated SPECT to CASToR data file using castor-GATERootToCastor, though it causes an error ‘Error : Axial and transaxial bins values expected (use option -sp_bins)’. I tried to add ‘sp bins nbinsT,nbinsA : 1, 1’ to .geom file as it is a monolithic crystal, but it stills causes the same error. Any suggestion and workaround would be highly appreciated.

castor-GATERootToCastor -i /home/ghaem/GATE9.2/Gate/GateContrib-master/imaging/SPECT/y_benchSPECT.root -o /home/ghaem/CASTOR/castor_v3.1.1/config/scanner/test/file.cdh -m /home/ghaem/GATE9.2/Gate/GateContrib-master/imaging/SPECT/one_spect.mac -s h
0 : /home/ghaem/GATE9.2/Gate/GateContrib-master/imaging/SPECT/one_spect.mac
1 : /home/ghaem/GATE9.2/Gate/GateContrib-master/imaging/SPECT/MoveVisu.mac
2 : /home/ghaem/GATE9.2/Gate/GateContrib-master/imaging/SPECT/Verbose.mac
— Start conversion of datafile(s) : /home/ghaem/GATE9.2/Gate/GateContrib-master/imaging/SPECT/y_benchSPECT.root
using mac file: /home/ghaem/GATE9.2/Gate/GateContrib-master/imaging/SPECT/one_spect.mac
CASToR output header datafile: /home/ghaem/CASTOR/castor_v3.1.1/config/scanner/test/file.cdh.Cdh
CASToR output binary datafile: /home/ghaem/CASTOR/castor_v3.1.1/config/scanner/test/file.cdh.Cdf

***** The following error message was issued by MPI instance 0
**** castor-GATERootToCastor :: Error : Axial and transaxial bins values expected (use option -sp_bins) !
***** The following error message was issued by MPI instance 0
***** Exit function called. Abort with code 1.

The code was also changed this way, but the same error occurred again!

castor-GATERootToCastor -i y_benchSPECT.root -o my_castor -m one_spect.mac -s h
0 : one_spect.mac
1 : MoveVisu.mac
2 : Verbose.mac
— Start conversion of datafile(s) : y_benchSPECT.root
using mac file: one_spect.mac
CASToR output header datafile: my_castor.Cdh
CASToR output binary datafile: my_castor.Cdf

***** The following error message was issued by MPI instance 0
**** castor-GATERootToCastor :: Error : Axial and transaxial bins values expected (use option -sp_bins) !
***** The following error message was issued by MPI instance 0
***** Exit function called. Abort with code 1.

Hi,
CASToR uses discrete detector for the generation of the geometry (the datafile contains the index of a detector. During reconstruction it is associated to a XYZ position using the geometry information).
For monolithic crystals, the sp_bins command purpose is to generate a matrix of “virtual” detectors. The detected singles in your file will be associated to a detector depending on their position, so even with a monolithic crystal you should provide as parameter a matrix of virtual detector/pixels (ideally matching the collimator geometry).

Hope this helps,
Thibaut

Dear Thibaut,
The problem was solved by trial and error before getting your answer. However, I appreciate the time you took to write me such thorough feedback.

Regards,
Mohammad