# Empy cdh after converting pixelated camera Root file from GATE 8.2

**URL:** <https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117>\
**Category:** General Discussions\
**Created:** [July 17, 2025, 7:02am UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117 "2025-07-17T07:02:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharareh](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Sharareh](https://castor-project.discourse.group/u/Sharareh)\
**Post date:** [July 17, 2025, 7:02am UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/1 "2025-07-17T07:02:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [July 21, 2025, 6:00pm UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/2 "2025-07-21T18:00:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sharareh](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Sharareh](https://castor-project.discourse.group/u/Sharareh)\
**Post date:** [July 22, 2025, 11:17am UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/3 "2025-07-22T11:17:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [July 23, 2025, 7:42pm UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/4 "2025-07-23T19:42:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sharareh](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Sharareh](https://castor-project.discourse.group/u/Sharareh)\
**Post date:** [July 24, 2025, 2:58pm UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/5 "2025-07-24T14:58:42Z")

</div>

Hi Thibaut

 ![image](https://global.discourse-cdn.com/free1/uploads/castor_project/original/1X/0c88febfb232a886e4c2b38efecc9b20084f68aa.png)

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [July 24, 2025, 8:49pm UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/6 "2025-07-24T20:49:50Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Sharareh](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Sharareh](https://castor-project.discourse.group/u/Sharareh)\
**Post date:** [July 25, 2025, 9:27am UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/7 "2025-07-25T09:27:31Z")

</div>

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

Thank you very much

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [August 1, 2025, 9:17pm UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/8 "2025-08-01T21:17:51Z")

</div>

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 ?

> **[FileSender](https://filesender.renater.fr/?s=download&token=7778f009-a59b-4b54-a66e-f9c0b5e544b6)**

Best,  
Thibaut

---

<div class="post-metadata">

**Author:** ![Sharareh](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Sharareh](https://castor-project.discourse.group/u/Sharareh)\
**Post date:** [August 8, 2025, 9:18am UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/9 "2025-08-08T09:18:26Z")

</div>

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

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

Best regards,

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [August 8, 2025, 4:48pm UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/10 "2025-08-08T16:48:31Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Sharareh](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Sharareh](https://castor-project.discourse.group/u/Sharareh)\
**Post date:** [August 9, 2025, 11:26am UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/11 "2025-08-09T11:26:15Z")

</div>

Thank you very much🙏

---

<div class="post-metadata">

**Author:** ![savvidis](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@savvidis](https://castor-project.discourse.group/u/savvidis)\
**Post date:** [October 22, 2025, 1:59pm UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/12 "2025-10-22T13:59:11Z")

</div>

Hi Thibaut,

It is maybe possible to provide the latest updates on the code, since I face the same problem when I am trying to do conversion for SPECT pixelated camera, using the GATERootToCastor? Unfortunately, I am not able to see the attached file anymore.

Best,

GIorgos

---

<div class="post-metadata">

**Author:** ![savvidis](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@savvidis](https://castor-project.discourse.group/u/savvidis)\
**Post date:** [October 23, 2025, 10:35am UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/13 "2025-10-23T10:35:39Z")

</div>

Hello again Thibaut,

I tried to reproduce the uploaded code, on Gate 9.1 and I received the error in the attached image when I run the GATERootToCastor, despite I use the updated version of CASToR (v3.2) which mentions small bug fixes for SPECT . Any help would be very important!

Many thanks in advance.

Giorgos

 ![Screenshot From 2025-10-23 13-30-11](https://global.discourse-cdn.com/free1/uploads/castor_project/original/1X/26a75cd9b14a2264ff0ef77e4d8abf85a98bcab3.png)

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [October 24, 2025, 7:35pm UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/14 "2025-10-24T19:35:56Z")

</div>

Hi Giorgos,

Here is the link to the patched version previously posted:

> **[FileSender](https://filesender.renater.fr/?s=download&token=eee4e2a1-32c2-41c6-95fb-dfd7fc20a1b0)**

Let me know if the issue remains, in this case I would have a closer look next week.

Best,  
Thibaut

---

<div class="post-metadata">

**Author:** ![savvidis](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@savvidis](https://castor-project.discourse.group/u/savvidis)\
**Post date:** [November 4, 2025, 10:39am UTC](https://castor-project.discourse.group/t/empy-cdh-after-converting-pixelated-camera-root-file-from-gate-8-2/1117/15 "2025-11-04T10:39:52Z")

</div>

Hello Thibaut,

Thank you for your reply, now the pixelated SPECT camera is converted without any issues. Many thanks once again for your help! 🙂

Best

Giorgos
