- Installation
- Using Conda
- Using pip
- Content of this repository
- Cheat sheet
- Test installation (now compatible with gVXR 2.1.0)
- First X-ray simulation (now compatible with gVXR 2.1.0)
- Numpy integration (now compatible with gVXR 2.1.0)
- 3D visualisation (now compatible with gVXR 2.1.0)
- Multi-material anatomical example (now compatible with gVXR 2.1.0)
- Polychromtic X-ray tube spectra (now compatible with gVXR 2.1.0)
- Scintillation (now compatible with gVXR 2.1.0)
- Monte Carlo vs. determinist (now compatible with gVXR 2.1.0)
- Ideal CT scan (now compatible with gVXR 2.1.0)
- Low dose CT scan (now compatible with gVXR 2.1.0)
- Creating, combining and moving 3D objects
- Built-in phantoms
- Multi-material samples using chemical elements, mixtures and compounds
- Source types and paramaters
- Detector paramaters
- Realistic CT scans
- Artefacts in CT images
- Spectral radiography (now compatible with gVXR 2.1.0)
- Spectral CT imaging
- 2D-3D registration of a clinical digital radiograph
- How to find help
- How to report bugs/request a new feature
- Q&A
- How to cite
- Research excellence
- User contributions
conda env create -f environment.yml
conda activate gvxr-tutorialspip install gvxr
pip install matplotlib viewscad xpecgen spekpy SimpleITK k3d- Cheat sheet: This document list all gVXR's functions used in the tutorial notebooks. It also includes the help messages to describe the purpose of each function.
- Test installation: Run the quick test script provided with gVirtualXray's Python package to make sure the installation is working well on your system.
- First X-ray simulation: Explore the step-by-step notebook to create our first X-ray radiograph. A mono-material object is imaged with a monochromatic source and an ideal detector. We show how to visualise the X-ray radiograph and take a screenshot of the 3D visualisation of the simulation environment.
- Numpy integration: Experiment with the Numpy integration to speed up the simulation.
- 3D visualisation: Get familiar with the three different 3D visualisation method provided with gVXR, i) K3D to interactively visualise the 3D scene in a Jupyter widget, ii) a customisable static 3D visualisation, and iii) an interactive 3D visualisation window.
- Multi-material anatomical example: Using the knowledge learnt in First X-ray simulation, initialise your own simulation to create a radiograph of the Lungman phantom.
-
Polychromtic X-ray tube spectra: In this notebook we explore how to specify polychromtic X-ray tube spectra, without and with filtration. We also shows how to plot the spectrum.
-
Scintillation: In this notebook we explore how to create a detector with a scintillator. We also shows how to plot the corresponding energy response.
-
Ideal CT scan: Simulate a CT scan acquisition with gVXR and reconstruct the CT volume with CIL. As a bonus, we explore how to visualise the data in 2D using CIL's widgets, and also using 3D volume rendering with K3D.
-
Segmentation to simulation: Create a CT reconstruction from data simulated using a segmented image to model the sample.
-
Monte Carlo vs. determinist: In this notebook, we run a simulation with gVXR and the corresponding one with Gate. Both simulations use the same number of emitted photons. This is to make sure the noise is well callibrated in gVXR.
-
Low dose CT scan: Simulate a low-dose CT scan acquisition with gVXR and reconstruct the CT volume with CIL using both the famous FDK algorithm and an iterative method with TV-regularisation.
-
Setting up a simulation with a JSON file: We will replicate a real CT scan acquisition taking into account the source and detector properties as finely as possible. We'll use the metadata generated by the device to create a human-friendly JSON file that describes our virtual experiment.
-
Beam hardening in CT images: We will do the same as in the previous notebook, but this time with a multi-material sample, the section of electric cable.
-
Creating, combining and moving 3D objects: Exploit gVXR built-in functionality to create our own model by combining spheres, cuboids and cylinders.
-
Built-in phantoms: spheres in cylinders, foam, step wedge
-
Multi-material samples using chemical elements, mixtures and compounds
-
Source types and paramaters: Differentiate between source types (parallel beam, e.g. synchrotron, and cone-beam, e.g. X-ray tube). For X-ray tube add extra levels of realism with the focal spot and polychromatic spectrum. Introduce the notion of magnification to compute the pixel size in radiography.
-
Detector paramaters: Revisit the notion of pixel size and add extra levels of realism with the point spread function and scintillator material.
-
Realistic CT scans: Using some of the knowledge learnt in the notebooks above, create realistic CT scan acquisitions for both synchrotron and labCT.
-
Artefacts in CT images: Explore the common source of artefact in CT images:
- For aliasing artefacts, you may look at Ideal CT scan where the number of projections was far too low.
- For low dose CT scans, you may look at Low dose CT scan where you can control the noise level and the number of projections.
-
Spectral radiography: Make use of an energy-resolved detector.
-
Spectral CT imaging:
-
2D-3D registration of a clinical digital radiograph:
-
Laminography:
-
Helical CT scans:
- Email me (Franck P. Vidal, STFC);
- Raise an issue on GitHub: https://github.com/TomographicImaging/gVXR-Tutorials/issues
- Open a ticket on SourceForge: https://sourceforge.net/p/gvirtualxray/tickets;
- Use the forum on SourceForge: https://sourceforge.net/p/gvirtualxray/discussion/;
- Subscribe to the mailing list: https://sourceforge.net/projects/gvirtualxray/lists/gvirtualxray-discuss
- Check the technical documentation, e.g. calling
help(gvxr)for help on the Python package or something likehelp(gvxr.createNewContext)for a specific function. - Look at the cheat sheet that lists all the gVXR's functions used in the tutorial notebooks. It also includes the help messages to describe the purpose of each function.
- Email me (Franck P. Vidal, STFC);
- Raise an issue on GitHub: https://github.com/TomographicImaging/gVXR-Tutorials/issues
- Open a ticket on SourceForge: https://sourceforge.net/p/gvirtualxray/tickets;
- Use the forum on SourceForge: https://sourceforge.net/p/gvirtualxray/discussion/;
See Q&A.
If you use gVXR in your own applications, particularly for research & development, I will be grateful if you could cite the articles as follows:
Community review paper: F.P. Vidal, S. Afshari, S. Ahmed, A. Albiol, F. Albiol, É. Béchet, A. Corbí Bellot, S. Bosse, S. Burkhard, Y. Chahid, C.-Y. Chou, R. Culver, P. Desbarats, L. Dixon, J. Friemann, A. Garbout, M. García-Lorenzo, J.-F. Giovannelli, R. Hanna, C. Hatton, A. Henry, G. Kelly, C. Leblanc, A. Leonardi, J. M. Létang, H. Lipscomb, T. Manchester, B. Meere, C. Michelet, S. Middleburgh, R.P. Mihail, I.T. Mitchell, L. Perera, M. Puig, M. Racy, A. Rouwane, H. Seznec, A. Sújar, J. Tugwell-Allsup, and P.-F. Villard: X-ray simulations with gVXR in education, digital twining, experiment planning, and data analysis Nuclear Instruments and Methods in Physics Research Section B: Beam Interactions with Materials and Atoms, 568 (2025), pp. 165804, doi: 10.1016/j.nimb.2025.165804
Clinical validation study: J.L. Pointon, T. Wen, J. Tugwell-Allsup, A. Sújar, J.M. Létang, and F.P. Vidal: Simulation of X-ray projections on GPU: Benchmarking gVirtualXray with clinically realistic phantoms. Computer Methods and Programs in Biomedicine, 234 (2023), pp. 107500, doi: 10.1016/j.cmpb.2023.107500
First reference to gVXR as an opensource software: F.P. Vidal and P.-F. Villard: Development and validation of real-time simulation of X-ray imaging with respiratory motion. Computerized Medical Imaging Graphics, 49 (2016), pp. 1-15, doi: 10.1016/j.compmedimag.2015.12.002
Seminal paper: F.P. Vidal, M. Garnier, N. Freud, J.M. Létang, and N.W. John: Simulation of X-ray attenuation on the GPU. Proceedings of Theory and Practice of Computer Graphics 2009, Eurographics Association, Cardiff, UK (2009), pp. 25-32, doi: 10.2312/LocalChapterEvents/TPCG/TPCG09/025-032
We'd like to share user contributions in a new section of gVXR's website https://gvirtualxray.sourceforge.io/. If you'd like to showcase your work, please contact me by email (Franck P. Vidal, STFC) or raise an issue on GitHub (https://github.com/TomographicImaging/gVXR-Tutorials/issues).

