Recent posts
#21
Geometry, Material & Navigation / The meaning of source_isocente...
Last post by mwj12 - Nov 26, 2025, 04:50 AMIn the doc examples, it appears that CT x-ray sources and CT detectors are independent elements, created respectively with GGEMSXRaySource and GGEMSCTSystem. For example, In visualization.py, it is shown how you can have two GGEMSXRaySource and two GGEMSCTSystem components in the same simulation, none belonging to the other.
How is it then that each GGEMSCTSystem object has geometry parameters source_isocenter_distance and source_detector_distance which seem to be tied to a particular x-ray source? In particular, when we use code like the following to set these parameters, which x-ray source are the distances set relative to if there happens to be more than one source?
How is it then that each GGEMSCTSystem object has geometry parameters source_isocenter_distance and source_detector_distance which seem to be tied to a particular x-ray source? In particular, when we use code like the following to set these parameters, which x-ray source are the distances set relative to if there happens to be more than one source?
Code Select
cbct_system = GGEMSCTSystem('detector')
cbct_system.set_ct_type('flat')
cbct_system.set_source_detector_distance(1500.5, 'mm')
cbct_system.set_source_isocenter_distance(900.0, 'mm')
#22
Geometry, Material & Navigation / Angular rotation conventions
Last post by mwj12 - Nov 20, 2025, 01:17 PMWhen specifying the angular pose of an element, e.g.,
Code Select
phantom.set_rotation(30.0, 40.0, 50.0, 'deg')
I assume this specifies a sequence of rotations about the X, Y, and Z axes, but in what order? And are these intrinsic or extrinsic rotations? #23
Output Data / Re: CBCT simulation output (en...
Last post by mwj12 - Nov 19, 2025, 05:47 PM OK. In any case, I think I found a simpler workaround. If you modify the spectrum.dat file so that fraction of photons in each row of the table is weighted by the photon energy, it should give you the same mean signal (scatter and primary?) as an energy-integrating detector. It won't give the same noise statistics, but for my present purposes, that's okay.
#24
Output Data / Re: CBCT simulation output (en...
Last post by didier.benoit - Nov 19, 2025, 11:31 AMYou can already add the number of source you want in GGEMS and set the number of particles.
You have a exemple with to source here https://doc.ggems.fr/v1.3/example_6.html, you can see the macro file in 'ggems/examples/6_Visualization'. I don't have the commands that ChatGPT wrote you, but you can implement and adapt to you case.
You have a exemple with to source here https://doc.ggems.fr/v1.3/example_6.html, you can see the macro file in 'ggems/examples/6_Visualization'. I don't have the commands that ChatGPT wrote you, but you can implement and adapt to you case.
#25
Output Data / Re: Multiple detectors
Last post by didier.benoit - Nov 19, 2025, 11:23 AMGGEMSBox is only a volume to Draw, not more :-). See the example 3 : https://doc.ggems.fr/v1.3/example_3.html. It's just a tool to create a voxelised phantom. If you don't have data, I think it's nice to draw some volume. It's not a navigator.
#26
Output Data / Re: Multiple detectors
Last post by mwj12 - Nov 12, 2025, 02:15 PMQuote from: didier.benoit on Nov 12, 2025, 11:33 AMIn GGEMS, any volume that defines its own geometry and interaction rules can act as a navigator.
GGEMSCTSystem does this too, since it manages detector modules with defined boundaries and materials.
That is interesting, as I said, but it seems to contradict what you said in this earlier thread. There, you said things like the GGEMSBox are not navigators, and that they simply act as a tool for writing out voxelized .mhd phantoms.
Code Select
box = GGEMSBox(24.0, 36.0, 56.0, 'mm')
box.set_position(-70.0, -30.0, 10.0, 'mm')
box.set_label_value(1)
box.set_material('Water')
Since this object has defined boundaries and materials, I wonder why it doesn't act as a navigator, like you said all objects do.
#27
Output Data / Re: CBCT simulation output (en...
Last post by mwj12 - Nov 12, 2025, 12:57 PMThanks. I will ponder this.
Do you also have an opinion on the suggestion I mentioned from ChatGPT to emit with multiple sources? Is the following legitimate GGEMS code, or did ChatGPT just hallucinate this?
I think the idea here is that if you want a certain photon's energy to contribute more weight to the output, you can increase its FluenceWeight accordingly.
Do you also have an opinion on the suggestion I mentioned from ChatGPT to emit with multiple sources? Is the following legitimate GGEMS code, or did ChatGPT just hallucinate this?
Code Select
system = GGEMSCTSystem()
for E, w in zip(E_list, w_list):
s = GGEMSPrimarySource()
s.SetMonoEnergy(E)
s.SetFluenceWeight(w)
system.AddSource(s)
system.Run()
I think the idea here is that if you want a certain photon's energy to contribute more weight to the output, you can increase its FluenceWeight accordingly.
#28
Output Data / Re: Multiple detectors
Last post by mwj12 - Nov 12, 2025, 12:09 PMInteresting. Thanks again!
#29
Output Data / Re: CBCT simulation output (en...
Last post by didier.benoit - Nov 12, 2025, 11:51 AMHi,
If you want to experiment with an energy-integrating CT implementation, the relevant parts of the code are quite localised:
ggems/include/GGEMS/navigators/GGEMSCTSystem.hh
ggems/src/navigators/GGEMSCTSystem.cc
and, on the GPU side, ggems/src/TrackThroughGGEMSSolidBox.cl
That OpenCL kernel is the one handling photon hits for CT volumes defined by GGEMSSolidBox.
You'll find the key line around line 219: atomic_add(&histogram[voxel_id.x + voxel_id.y * virtual_element_number.x], 1);
That's where each detected photon increments the count.
For an energy-integrating detector, you'd replace the fixed 1 with the photon's energy (in keV or MeV, depending on your configuration), and adapt the accumulation type accordingly.
If you want to experiment with an energy-integrating CT implementation, the relevant parts of the code are quite localised:
ggems/include/GGEMS/navigators/GGEMSCTSystem.hh
ggems/src/navigators/GGEMSCTSystem.cc
and, on the GPU side, ggems/src/TrackThroughGGEMSSolidBox.cl
That OpenCL kernel is the one handling photon hits for CT volumes defined by GGEMSSolidBox.
You'll find the key line around line 219: atomic_add(&histogram[voxel_id.x + voxel_id.y * virtual_element_number.x], 1);
That's where each detected photon increments the count.
For an energy-integrating detector, you'd replace the fixed 1 with the photon's energy (in keV or MeV, depending on your configuration), and adapt the accumulation type accordingly.
#30
Output Data / Re: Multiple detectors
Last post by didier.benoit - Nov 12, 2025, 11:33 AMHi,
In GGEMS, any volume that defines its own geometry and interaction rules can act as a navigator.
GGEMSCTSystem does this too, since it manages detector modules with defined boundaries and materials.
So yes — you can see it as a third navigator type, but it's actually a navigator with output.
Every detector in GGEMS is, by design, also a navigator.
If you remove the output, it simply becomes a passive volume that still guides particles through its geometry.
In GGEMS, any volume that defines its own geometry and interaction rules can act as a navigator.
GGEMSCTSystem does this too, since it manages detector modules with defined boundaries and materials.
So yes — you can see it as a third navigator type, but it's actually a navigator with output.
Every detector in GGEMS is, by design, also a navigator.
If you remove the output, it simply becomes a passive volume that still guides particles through its geometry.