Recent posts

#31
Output Data / Re: Multiple detectors
Last post by didier.benoit - Nov 19, 2025, 11:23 AM
GGEMSBox 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.
#32
Output Data / Re: Multiple detectors
Last post by mwj12 - Nov 12, 2025, 02:15 PM
Quote 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.

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.
#33
Output Data / Re: CBCT simulation output (en...
Last post by mwj12 - Nov 12, 2025, 12:57 PM
Thanks. 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?
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.
#34
Output Data / Re: Multiple detectors
Last post by mwj12 - Nov 12, 2025, 12:09 PM
Interesting. Thanks again!
#35
Output Data / Re: CBCT simulation output (en...
Last post by didier.benoit - Nov 12, 2025, 11:51 AM
Hi,

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.
#36
Output Data / Re: Multiple detectors
Last post by didier.benoit - Nov 12, 2025, 11:33 AM
Hi,

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.
#37
Getting Started / Re: Building with OpenGL on Wi...
Last post by didier.benoit - Nov 12, 2025, 11:12 AM
Hi,

To use GLEW and GLM with GGEMS, please follow these steps:

- GLEW:
You simply need to install the official Windows binary from the GLEW website:
https://glew.sourceforge.net/
Direct download link: https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0-win32.zip/download
Once extracted and installed (typically under "C:/Program Files (x86)"), GLEW will be automatically detected by GGEMS during configuration, thanks to the FIND_PACKAGE(GLEW REQUIRED) command in CMake.
No manual CMake build of GLEW is needed on Windows.

- GLM:
You can install GLM by visiting the official repository:
https://github.com/g-truc/glm
Simply follow the installation recommendations provided there. GLM is a header-only library, so you usually just need to extract it and make sure its include path is visible to CMake.

Hope this helps and makes the setup smoother!
#38
Output Data / Re: CBCT simulation output (en...
Last post by mwj12 - Nov 06, 2025, 11:02 PM
ChatGPT suggests that one could spoof energy-integrated output by expressing the x-ray source as a weighted superposition of N separate mono-energetic x-ray sources, as below. I wonder if anyone can confirm this would work.
system = GGEMSCTSystem()
for E, w in zip(E_list, w_list):
    s = GGEMSPrimarySource()
    s.SetMonoEnergy(E)
    s.SetFluenceWeight(w)
    system.AddSource(s)
system.Run()
#39
Getting Started / Re: Building with OpenGL on Wi...
Last post by mwj12 - Nov 06, 2025, 12:32 PM
Thanks, GLFW seems to have installed successfully.

I would indeed be grateful for similar instructions for GLEW and GLM. In particular, the GLEW repo referenced in the documentation
https://github.com/nigels-com/glew
does not appear to be CMake-friendly:

C:\Users\MWJ12\Downloads\glew-master\glew-master>cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:/Program Files (x86)/GLEW"
CMake Error: The source directory "C:/Users/MWJ12/Downloads/glew-master/glew-master" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
#40
Output Data / Re: CBCT simulation output (en...
Last post by mwj12 - Nov 05, 2025, 08:45 PM
I see. Well, I really do need energy-integrating output. If I wished to create a new CT system class  GGEMSCTSystem_Integrating(), would you be able to point me to the files I need to modify? I would be willing to take on the coding myself, and to donate it to the repo, if there were any interest in including it.