Empy cdh after converting pixelated camera Root file from GATE 8.2

Hello CASToR team,

I’m encountering an issue when converting GATE simulation ROOT files to CDH format for a pixelated camera. After running the conversion, the output CDH file appears empty. My key question is: Does CASToR support reconstruction of pixelated cameras at all? Could you please advise?

Hi Sharareh,

CASToR converter does support the conversion of SPECT system with pixelated cameras from ROOT data, providing the GATE macro uses the /gate/systems/SPECThead/pixel/attach line.
Could you share details about the system, the .geom file which was created/used, or any error you encountered during the conversion ?

Best,
Thibaut M.

Dear Thibaut,

I’m encountering an issue when converting GATE simulation data to CASToR format for a pixelated SPECT system. Here are the details:

System Configuration (GATE Macro Highlights)

  • Pixelated detector with explicit attachment:
    /gate/systems/SPECThead/pixel/attach pixel
  • Crystal array: 9 (trans) × 40 (axial) BGO pixels
  • Digitizer setup:

text

  • /gate/digitizer/Singles/readout/setDepth 2 # for pixels
  • /gate/digitizer/Singles/readout/setDepth 1 # for crystal
  • Output: ROOT file (benchSPECT.root) with Singles data

Steps & Results

  1. Geometry Conversion (successful):
    castor-GATEMacToGeom -m /home/gate/cam11/SPECT.mac -o pixelated
    Output .geom file correctly lists:
  • 2 detector heads
  • 9 transaxial / 40 axial pixels
  • Collimator parameters
  1. ROOT Data Conversion (issue):
    castor-GATERootToCastor -i /home/gate/cam11/benchSPECT.root -o /home/gate/cam11/cam11 -m /home/gate/cam11/SPECT.mac -s pixelated
    3.Problem*: Output CDH file is empty (no data).

Request

Could you help troubleshoot:

  1. Why the CDH file remains empty despite valid inputs?
  2. Whether the GATE macro structure (crystal/pixel hierarchy) aligns with CASToR’s pixelated SPECT requirements?
  3. Any required adjustments to the digitizer or system attachment?

Attached: Full [SPECT.mac] & [.geom file] for reference.

Thank you!
Sharareh

Full [SPECT.mac]:

/gate/geometry/setMaterialDatabase data/GateMaterials.db

/gate/world/geometry/setXLength 100 cm

/gate/world/geometry/setYLength 100 cm

/gate/world/geometry/setZLength 100 cm

/gate/world/daughters/name SPECThead

/gate/world/daughters/insert box

/gate/SPECThead/geometry/setXLength 8. cm

/gate/SPECThead/geometry/setYLength 9.1 cm

/gate/SPECThead/geometry/setZLength 40.1 cm

/gate/SPECThead/placement/setTranslation 7.9 0. 0.0 cm

/gate/SPECThead/setMaterial Air

/gate/SPECThead/repeaters/insert ring

/gate/SPECThead/ring/setRepeatNumber 2

/gate/SPECThead/moves/insert orbiting

/gate/SPECThead/orbiting/setSpeed 5.625 deg/s

/gate/SPECThead/orbiting/setPoint1 0 0 0 cm

/gate/SPECThead/orbiting/setPoint2 0 0 1 cm

/gate/SPECThead/vis/forceWireframe

/gate/SPECThead/daughters/name shielding

/gate/SPECThead/daughters/insert box

/gate/shielding/geometry/setXLength 5. cm

/gate/shielding/geometry/setYLength 9.1 cm

/gate/shielding/geometry/setZLength 40.1 cm

/gate/shielding/placement/setTranslation -1.5 0. 0. cm

/gate/shielding/setMaterial Lead

/gate/shielding/vis/setColor red

/gate/shielding/vis/forceWireframe

/gate/SPECThead/daughters/name collimator

/gate/SPECThead/daughters/insert box

/gate/collimator/geometry/setXLength 5. cm

/gate/collimator/geometry/setYLength 9.1 cm

/gate/collimator/geometry/setZLength 40.1 cm

/gate/collimator/placement/setTranslation -1.5 0. 0. cm

/gate/collimator/setMaterial Lead

/gate/collimator/vis/setColor red

/gate/collimator/vis/forceWireframe

Insert the first hole of air in the collimator

/gate/collimator/daughters/name hole

/gate/collimator/daughters/insert box

/gate/hole/geometry/setXLength 5. cm

/gate/hole/geometry/setYLength 0.9 cm

/gate/hole/geometry/setZLength 0.9 cm

/gate/hole/placement/setTranslation 0. 0. 0. cm

/gate/hole/setMaterial Air

/gate/hole/repeaters/insert cubicArray

/gate/hole/cubicArray/setRepeatNumberX 1

/gate/hole/cubicArray/setRepeatNumberY 9

/gate/hole/cubicArray/setRepeatNumberZ 40

/gate/hole/cubicArray/setRepeatVector 0.0 1.0111 1.0025 cm

/gate/SPECThead/daughters/name crystal

/gate/SPECThead/daughters/insert box

/gate/crystal/geometry/setXLength 3. cm

/gate/crystal/geometry/setYLength 9.1 cm

/gate/crystal/geometry/setZLength 40.1 cm

/gate/crystal/placement/setTranslation 2.5 0. 0. cm

/gate/crystal/setMaterial Lead

/gate/crystal/daughters/name pixel

/gate/crystal/daughters/insert box

/gate/pixel/geometry/setXLength 3. cm

/gate/pixel/geometry/setYLength 0.9 cm

/gate/pixel/geometry/setZLength 0.9 cm

/gate/pixel/placement/setTranslation 0 0. 0. cm

/gate/pixel/setMaterial BGO

/gate/pixel/vis/setColor yellow

/gate/pixel/vis/forceSolid

/gate/pixel/repeaters/insert cubicArray

/gate/pixel/cubicArray/setRepeatNumberX 1

/gate/pixel/cubicArray/setRepeatNumberY 9

/gate/pixel/cubicArray/setRepeatNumberZ 40

/gate/pixel/cubicArray/setRepeatVector 0.0 1.0111 1.0025 cm

/gate/world/daughters/name Phantom

/gate/world/daughters/insert cylinder

/gate/Phantom/geometry/setRmax 1.9 cm

/gate/Phantom/geometry/setRmin 0. cm

/gate/Phantom/geometry/setHeight 29 cm

/gate/Phantom/placement/setTranslation 0. 0. 0. cm

/gate/Phantom/setMaterial PMMA

/gate/Phantom/vis/setColor blue

/gate/Phantom/vis/forceSolid

/gate/systems/SPECThead/crystal/attach crystal

/gate/systems/SPECThead/describe

/gate/Phantom/attachPhantomSD

/gate/shielding/attachPhantomSD

/gate/SPECThead/attachPhantomSD

/gate/collimator/attachPhantomSD

/gate/crystal/attachCrystalSD

/gate/pixel/attachCrystalSD

/gate/systems/SPECThead/pixel/attach pixel

P H Y S I C S

/gate/physics/addProcess PhotoElectric

/gate/physics/processes/PhotoElectric/setModel StandardModel

/gate/physics/addProcess Compton

/gate/physics/processes/Compton/setModel PenelopeModel

/gate/physics/addProcess RayleighScattering

/gate/physics/processes/RayleighScattering/setModel PenelopeModel

/gate/physics/addProcess ElectronIonisation

/gate/physics/processes/ElectronIonisation/setModel StandardModel e-

/gate/physics/addProcess Bremsstrahlung

/gate/physics/processes/Bremsstrahlung/setModel StandardModel e-

/gate/physics/addProcess MultipleScattering e-

/gate/physics/processList Enabled

/gate/physics/processList Initialized

C U T S

Cuts for particle in WORLD

/gate/physics/Gamma/SetCutInRegion SPECThead 0.1 cm

/gate/physics/Electron/SetCutInRegion SPECThead 1.0 cm

I N I T I A L I Z A T I O N

/gate/run/initialize

Show how the geometry moves with time

! After the initialization !

/control/execute MoveVisu.mac

D E F I N E T H E S O U R C E

/gate/source/addSource SourceConfinement

/gate/source/SourceConfinement/gps/type Volume

/gate/source/SourceConfinement/gps/shape Cylinder

/gate/source/SourceConfinement/gps/radius 1.5 cm

/gate/source/SourceConfinement/gps/halfz 14 cm

/gate/source/SourceConfinement/gps/centre 0. 0. 0. cm

/gate/source/SourceConfinement/gps/particle gamma

/gate/source/SourceConfinement/gps/energy 5 MeV

/gate/source/SourceConfinement/setActivity 30000. Bq

/gate/source/SourceConfinement/gps/angtype iso

D I G I T I Z E R

/gate/digitizer/Singles/insert adder

/gate/digitizer/Singles/insert blurring

/gate/digitizer/Singles/blurring/setResolution 0.10

/gate/digitizer/Singles/blurring/setEnergyOfReference 5 MeV

/gate/digitizer/Singles/insert spblurring

/gate/digitizer/Singles/spblurring/setSpresolution 2.0 mm

/gate/digitizer/Singles/spblurring/verbose 0

/gate/digitizer/Singles/insert thresholder

/gate/digitizer/Singles/thresholder/setThreshold 4 MeV

/gate/digitizer/Singles/insert upholder

/gate/digitizer/Singles/upholder/setUphold 6 MeV

#/gate/digitizer/Singles/insert opticaladder

/gate/digitizer/Singles/insert readout

for pixels:

/gate/digitizer/Singles/readout/setDepth 2

for crystal:

/gate/digitizer/Singles/readout/setDepth 1

O U T P U T

/gate/output/root/enable

/gate/output/root/setFileName benchSPECT

/gate/output/root/setRootSinglesAdderFlag 1

/gate/output/root/setRootSinglesBlurringFlag 1

/gate/output/root/setRootSinglesSpblurringFlag 1

/gate/output/root/setRootSinglesThresholderFlag 1

/gate/output/root/setRootSinglesUpholderFlag 1

/gate/output/root//setRootHitFlag 1

/gate/output/root/setRootSinglesFlag 1

/gate/output/root/setRootNtupleFlag 1

#/gate/output/ascii/setOutFileSinglesAdderFlag 0

#/gate/output/ascii/setOutFileSinglesSpblurringFlag 0

#/gate/output/ascii/setOutFileSinglesBlurringFlag 0

#/gate/output/ascii/setOutFileSinglesThresholderFlag 0

#/gate/output/ascii/setOutFileSinglesUpholderFlag 0

R A N D O M

JamesRandom Ranlux64 MersenneTwister

/gate/random/setEngineName Ranlux64

#/gate/random/setEngineSeed default

#/gate/random/setEngineSeed auto

/gate/random/setEngineSeed 123456789

#/gate/random/resetEngineFrom fileName

/gate/random/verbose 1

P R O J E C T I O N

/gate/output/projection/enable

/gate/output/projection/setFileName YourProjection

/gate/output/projection/pixelSizeX 1 mm

/gate/output/projection/pixelSizeY 1 mm

/gate/output/projection/pixelNumberX 38

/gate/output/projection/pixelNumberY 290

Specify the projection plane (XY, YZ or ZX)

/gate/output/projection/projectionPlane YZ

E X P E R I M E N T

/gate/application/setTimeSlice 1 s

/gate/application/setTimeStart 0. s

/gate/application/setTimeStop 32. s

/gate/application/startDAQ

Full [.geom]:

modality : SPECT_CONVERGENT

scanner name : h

number of detector heads : 2

trans number of pixels : 9

trans pixel size : 9

trans gap size : 1.111

axial number of pixels : 40

axial pixel size : 9

axial gap size : 1.025

detector depth : 30

scanner radius : 79,79

Collimator configuration :

head1:

trans focal model: constant

trans number of coef model: 1

trans parameters: 0

axial focal model: constant

axial number of coef model: 1

axial parameters: 0

head2:

trans focal model: constant

trans number of coef model: 1

trans parameters: 0

axial focal model: constant

axial number of coef model: 1

axial parameters: 0

default reconstruction parameters

voxels number transaxial : 20

voxels number axial : 101

field of view transaxial : 39.5

field of view axial : 401

description

description : SPECT camera extracted from GATE macro: /home/gate/cam11/SPECT.mac

Hi Sharareh,

The geometry file appears to be consistent with your simulation indeed.

I don’t see any potential issue for the conversion in your mac file, but if you get an empty Cdh file and no Cdf file, something must have gone wrong during the conversion of the root data.

Did you get any error message ? What output do you get if you increase verbosity (add -vb 2 to castor-GATERootToCastor command line) ?

Best,
Thibaut

Hi Thibaut

Hi,
Possibly a ROOT related issue judging from the error. Could you double check root global variables were correctly initialized?

If everything seems fine, maybe you could share me a link to the root file so that I could try to reproduce the error on my end and check what is wrong.

Best,

Hi
Root file share link: https://drive.google.com/file/d/1wj9xyZAHyA4ocOdkqnENRL1YSy5DSsxW/view?usp=sharing

Thank you very much

Hi Sharareh,

The problem seems to come from some latest updates of the code, which broke the conversion for SPECT pixelated cameras. Could you retry with the following version and let me know if the issue remains ?

Best,
Thibaut

Hi
Thank you for your help. The SPECT pixelated camera conversion issue is fixed with the latest code update. :folded_hands:

Quick question:
Can the FBP algorithmbe used for reconstruction in CASToR?

Best regards,

1 Like

Hello,

No there is no implementation of FBP with CASToR. The datafile format makes it difficult to implement a reconstruction like FBP which assumes that the data are organized as true sinograms/projections.

Best,

Thank you very much🙏