About the conversion of gate data

hello everyone:
When I want to convert a data file obtained from a GATE simulation to a castor data file, do I need to install GATE and can I complete the conversion without installing the GATE software.

If my memory serves right, CASToR “only” offers a converter for GATE acquisitions saved in the ROOT format. As such, it does not need GATE for the conversion, but it need ROOT.

Note: you can see this when compiling CASToR: if you set “GATE utilities” to True, it ask only for the path toward the ROOT program/script/thingy.

Hi,
Maxime has good memory :slightly_smiling_face:
Indeed the converter only works with ROOT output format, so only ROOT library is required to perform the conversion.

Hi Thibaut,

I am also trying to convert the root data (simulation of a ecat system) generated by GATE but this process has not been smooth.

Following the instruction provided in the general documentation of CASToR, I believe I have successfully installed the GATE utilities. In addition, the .geom file generated by castor-GATEMacToGeom also seems reasonable to me. However, castor-GATERootToCastor cannot convert the root file generated by GATE to those compatible with CASToR.

The only thing (or violation) that I can think about is: the geometry I used for GATE simulation has applied both linear repeater and ring repeater in the first hierarchic level (block for ecat), while in the general documentation, it is mentioned that it is assumed that the first hierarchic level element (i.e rsector for cylindricalPET and block for ecat) use a ring repeater. Do you think this could be the cause of my problem? If so, how should we create geometry for PET system that has multiple rings along the axial direction?

In text below, I have pasted how I called castor-GATERootToCastor in the terminal and what error message has been printed. However, I am rather clueless toward what it means.

bogao@cri-gpu:~/castor/castor_v3.1.1$ castor-GATERootToCastor -i /home/bwang/JOYbrain3/output/SimJoyBrainAtt_360.Coincidences.root -o /home/bogao/castor/GateSim/JoyBrain/SimJoyBrainAtt_360Coin -m /home/bwang/JOYbrain3/Gatescript_360.mac -s JOYBrain3 -oh
0 : /home/bwang/JOYbrain3/Gatescript_360.mac
 --- Start conversion of datafile(s) : /home/bwang/JOYbrain3/output/SimJoyBrainAtt_360.Coincidences.root
     using mac file: /home/bwang/JOYbrain3/Gatescript_360.mac
     CASToR output header datafile: /home/bogao/castor/GateSim/JoyBrain/SimJoyBrainAtt_360Coin.Cdh
     CASToR output binary datafile: /home/bogao/castor/GateSim/JoyBrain/SimJoyBrainAtt_360Coin.Cdf


 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007f6fc98f4c3a in __GI___wait4 (pid=4059268, stat_loc=stat_loc
entry=0x7ffe5dc01228, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:27
#1  0x00007f6fc98f4bfb in __GI___waitpid (pid=<optimized out>, stat_loc=stat_loc
entry=0x7ffe5dc01228, options=options
entry=0) at waitpid.c:38
#2  0x00007f6fc9863f67 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:172
#3  0x00007f6fca4896de in TUnixSystem::StackTrace() () from /home/bogao/root/root/lib/libCore.so.6.26
#4  0x00007f6fca486565 in TUnixSystem::DispatchSignals(ESignals) () from /home/bogao/root/root/lib/libCore.so.6.26
#5  <signal handler called>
#6  0x000055c8f457ad24 in main ()
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum https://root.cern/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6  0x000055c8f457ad24 in main ()
===========================================================

Hi Bo,

Try to change your input root file name from SimJoyBrainAtt_360.Coincidences.root to SimJoyBrainAtt_360_Coincidences.root.

Best,
Xinjie

Hi Xinjie,

Thanks for your quick repliy! I modified the name of the root file just now but unfortunately the problem still exists. :slightly_frowning_face:

Nevertheless, thanks for your reply and this is indeed a perspective we have never thought about.

Kind regards,
Bo

Would you mind sharing your GATE macro for this root file? Also, if you can share the corresponding .geom file, that would be better. I will have a glance at it.

Best,
Xinjie

Hi all,

My colleague has figured out the problem in our case.

In short, currently GATE offers two approaches to generate root file. The first one is the conventional method and the utilities provided by CASToR has no issues to convert root files generated with such approach.

However, another approach (which is currently being recommended by GATE) to generate the root file is to use the GateToTree class. Unfortunately, the utilities provided by CASToR cannot convert the root file generated by such approach.

Hope such information could also be helpful to someone in the future :smiley:

Kind regards,
Bo

2 Likes

Hi Xinjie,

Since we have already found the problem, I guess it is no longer necessary for me to sent the .geom file or GATE macro to you.

Nevertheless, please accept my sincere gratitude for having such a nice member in our community.

Kind regards,
Bo

Hi Bo,
Thank you for the information. At the time the converter was implemented this approach was not available, the code will have to be updated in order to read the new macro commands. Definitely something we will have to look at!

Kind regards,
Thibaut