Recent posts

#41
Output Data / Re: Multiple detectors
Last post by mwj12 - Nov 05, 2025, 08:36 PM
Quote from: didier.benoit on Nov 05, 2025, 04:15 PMHi, if you want to build a multi-layer setup, then yes — you need to create 4 navigators (GGEMSCTSystem) and place them next to each other. You will then get 4 projection output files. Just be careful with navigator overlaps, but it should work.

OK, thanks. But I find it interesting that you seem to say above that GGEMSCTSystem objects can be considered navigators. The documentation section on navigators only mentions GGEMSVoxelizedPhantom and GGEMSMeshedPhantom. You are saying that GGEMSCTSystem produces a 3rd navigator type?

If so, I wonder if one can make an "output-less" GGEMSCTSystem as a simple way of implementing a navigator for arbitrary rectangular objects (not necessarily detectors) ? For example, if I wanted to put a copper filtering sheet in front of my detector, to block  high energy photons, could I spoof an appropriate navigator for the sheet as below, where I have deliberately set nothing for sheet.save()?
sheet = GGEMSCTSystem('Copper Sheet')
sheet.set_ct_type('flat')
sheet.set_number_of_modules(1, 1)
sheet.set_number_of_detection_elements(1, 1)
sheet.set_size_of_detection_elements(300, 400, 0.7, 'mm')
sheet.set_material('Cu')
sheet.set_source_isocenter_distance(1000.0, 'mm')
sheet.set_source_detector_distance(1500.0, 'mm')
#sheet.set_threshold(20.0, 'keV')
sheet.set_rotation(0.0, 0.0, -90.0, 'deg')
#sheet.save('data/truebeam_projection')
#sheet.store_scatter(False)
#42
Getting Started / Re: Building with OpenGL on Wi...
Last post by didier.benoit - Nov 05, 2025, 04:55 PM
At the moment CMake cannot find GLFW because it is probably missing the CMake configuration files that GLFW normally installs.
Even if you already have include/ and lib/, CMake requires the following files to be present:

C:\Program Files (x86)\GLFW\lib\cmake\glfw3\
    ├─ glfw3Config.cmake
    ├─ glfw3ConfigVersion.cmake
    └─ glfw3Targets.cmake

If this folder or these files are missing, then find_package(GLFW3) will always fail. GGEMS expects the CMake version of GLFW — not just the binaries.

Install GLFW from source using admin privilege

git clone https://github.com/glfw/glfw.git
cd glfw
cmake -B build -DCMAKE_BUILD_TYPE=Release  -DCMAKE_INSTALL_PREFIX="C:/Program Files (x86)/GLFW"
cmake --build build --config Release
cmake --install build --config Release

Optional: If you want to automatically add GLFW/GLEW to your environment in PowerShell:

function OpenGL-cmd {
    $env:Path    += ";C:\Program Files (x86)\GLFW\bin;C:\Program Files (x86)\GLEW\bin\Release\x64;"
    $env:Include += ";C:\Program Files (x86)\GLFW\include;C:\Program Files (x86)\GLEW\include;"
    $env:Lib     += ";C:\Program Files (x86)\GLFW\lib;C:\Program Files (x86)\GLEW\lib\Release\x64;"
}
Set-Alias -Name opengl -Value OpenGL-cmd

Then just type "opengl" in the terminal before building GGEMS. Let me know if you want the same instructions for GLEW or GLM.
#43
No, these are not navigators. I created this tool to automatically generate test volumes, which are then used as voxelised navigators. It's mainly to create phantoms quickly. In the examples, you'll see how I use them.
#44
Output Data / Re: CBCT simulation output (en...
Last post by didier.benoit - Nov 05, 2025, 04:21 PM
There is no energy integration for CT in GGEMS. We only implemented the CT detector as a photon-counting detector, so the output is always just the number of hits (for both the final image and the scatter). It's not really a realistic CT model.
I'm not a CT specialist, but yes, I believe real CT scanners do use energy integration. So in GGEMS you're already working in photon-counting mode.
#45
Output Data / Re: Multiple detectors
Last post by didier.benoit - Nov 05, 2025, 04:15 PM
Hi, if you want to build a multi-layer setup, then yes — you need to create 4 navigators (GGEMSCTSystem) and place them next to each other. You will then get 4 projection output files. Just be careful with navigator overlaps, but it should work.
#46
Getting Started / Building with OpenGL on Window...
Last post by mwj12 - Nov 05, 2025, 01:20 AM
I am trying to build with opengl=ON in Windows 11, but am getting the errors below. I have no problems with opengl=OFF.

C:\GGEMS\ggems>python setup.py build_ext --opengl=ON install --user
running build_ext
cmake C:\GGEMS\ggems -DCMAKE_BUILD_TYPE=Release -DOPENGL_VISUALIZATION=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=C:\GGEMS\ggems\build\lib.win-amd64-cpython-311
-- CUDA Toolkit: TRUE
-- CUDA Toolkit VERSION: 12.8.61
-- CUDA Toolkit INCLUDE DIRS: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/include
-- CUDA Toolkit LIBRARY DIR: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/lib/x64
CMake Error at C:/Program Files/CMake/share/cmake-4.2/Modules/FindPackageHandleStandardArgs.cmake:290 (message):
  Could NOT find GLFW3 (missing: GLFW3_LIBRARY)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-4.2/Modules/FindPackageHandleStandardArgs.cmake:654 (_FPHSA_FAILURE_MESSAGE)
  cmake-config/FindGLFW3.cmake:49 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:101 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
error: command 'C:\\Program Files\\CMake\\bin\\cmake.EXE' failed with exit code 1


The GGEMS v1.3 documentation instructs that GLFW should be installed in C:/Program Files (x86). I interpret this to mean there should be a folder C:\Program Files (x86)\GLFW that looks like below. Does it look right?

C:\GGEMS\ggems>dir "C:\Program Files (x86)\GLFW"
 Volume in drive C is OS
 Volume Serial Number is CC8D-AE76

 Directory of C:\Program Files (x86)\GLFW

11/04/2025  07:07 PM    <DIR>          .
11/04/2025  07:05 PM    <DIR>          ..
11/04/2025  05:36 PM    <DIR>          docs
11/04/2025  05:36 PM    <DIR>          include
11/04/2025  05:36 PM    <DIR>          lib-mingw-w64
11/04/2025  05:36 PM    <DIR>          lib-static-ucrt
11/04/2025  05:36 PM    <DIR>          lib-vc2013
11/04/2025  05:36 PM    <DIR>          lib-vc2015
11/04/2025  05:36 PM    <DIR>          lib-vc2017
11/04/2025  05:36 PM    <DIR>          lib-vc2019
11/04/2025  05:36 PM    <DIR>          lib-vc2022
11/04/2025  05:25 PM               904 LICENSE.md
11/04/2025  05:25 PM             2,557 README.md
               2 File(s)          3,461 bytes
              11 Dir(s)  367,315,611,648 bytes free
#47
Particles, Track & Event / Re: secondary photon removal
Last post by julienzzzz - Nov 04, 2025, 09:19 PM
Hi Didier,

Thank you so much. It is very helpful.

Thanks,
Julien
#48
Output Data / Multiple detectors
Last post by mwj12 - Nov 04, 2025, 02:22 PM
I am gradually trying to evolve my single CBCT detector simulation into a multi-layer CBCT detector simulation. I might have anywhere between 1 and 4 detector layers. Is it possible to set up a simulation with more than one detector plane in the same simulation?

When I do this, I will want each layer's detector output to feel the effects of attenuation from the layers that come before it in the beam path. I will also want it to feel the effects of scatter from neighboring layers both before and after it in the beam path. I assume this means I will need to define a navigator for each detector layer. If so, am I still using GGEMSCTSystem to implement the detection process? Can navigators and GGEMSCTSystems occupy the same 3D space?
#49
Output Data / CBCT simulation output (energy...
Last post by mwj12 - Nov 04, 2025, 02:10 PM
I am new to GGEMS and trying to generate simulated CBCT projections. As an initial example, I am implementing the detector as below, with scattered detections stored separately. My question is about whether the output that gets stored is energy-integrated or not, i.e., do the photon detections get weighted by their energies when tallying the final projection image. I have heard some rumors that, while the primary detections will be energy integrated, the scattered projections may not be. Is this fake news? And if I wanted to toggle energy integration on or off, say, to simulate a photon counting detector, is there way to do that for both primary and scatter?

# TrueBeam CBCT geometry
ct_detector = GGEMSCTSystem('TrueBeam_CBCT')
ct_detector.set_ct_type('flat')
ct_detector.set_number_of_modules(1, 1)
ct_detector.set_number_of_detection_elements(193,257, 1)
ct_detector.set_size_of_detection_elements(0.776*2, 0.776*2, 0.7, 'mm')
ct_detector.set_material('CsI')
ct_detector.set_source_isocenter_distance(1000.0, 'mm')
ct_detector.set_source_detector_distance(1500.0, 'mm')
ct_detector.set_threshold(20.0, 'keV')
ct_detector.set_rotation(0.0, 0.0, -90.0, 'deg')
ct_detector.save('data/truebeam_projection')
ct_detector.store_scatter(True)
#50
Thanks a lot! When you say that
QuoteGGEMS does not support analytical navigators.
does that mean that the geometric shape generators, like,

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')

do not define a navigators? Or are these meshed  navigators in disguise?