Skip to content

TomographicImaging/gVXR-Tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hands-on training: Simulating X-ray images on GPU with gVirtualXray (gVXR)

Simulated radiograph of the Lungman phantom

PyPI Downloads Open in Colab Binder

Content of this file

Installation

Using Conda

conda env create -f environment.yml
conda activate gvxr-tutorials

Using pip

pip install gvxr
pip install matplotlib viewscad xpecgen spekpy SimpleITK k3d

Content of this repository

  • 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. Open In Colab
  • 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. Open In Colab
  • Numpy integration: Experiment with the Numpy integration to speed up the simulation. Open In Colab
  • 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. Open In Colab
  • 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. Open In Colab
  • 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. Open In Colab

  • Scintillation: In this notebook we explore how to create a detector with a scintillator. We also shows how to plot the corresponding energy response. Open In Colab

  • 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. Open In Colab

  • 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. Open In Colab

  • 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. Open In Colab

  • 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. Open In Colab

  • 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. Open In Colab

  • 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 CT imaging:

  • 2D-3D registration of a clinical digital radiograph:

  • Laminography:

  • Helical CT scans:

How to find help

How to report bugs or request a new feature

Q&A

See Q&A.

How to cite

If you use gVXR in your own applications, particularly for research & development, I will be grateful if you could cite the articles as follows:

  • Seminal paper: Vidal, F. P., Garnier, M., Freud, N., Létang, J. M., and John, N. W., “Simulation of x-ray attenuation on the GPU,” in Proceedings of Theory and Practice of Computer Graphics 2009, 25–32, Eurographics Association, Cardiff, UK (June 2009). DOI: 10.2312/LocalChapterEvents/TPCG/TPCG09/025-032
  • First reference to gVXR as an opensource software: Vidal, F. P. and Villard, P.-F., “Development and validation of real-time simulation of x-ray imaging with respiratory motion,” Computerized Medical Imaging and Graphics 49, 1–15 (2016). DOI: 10.1016/j.compmedimag.2015.12.002
  • Clinical validation study: Pointon, J. L., Wen, T., Tugwell-Allsup, J., Sújar, A., Létang, J. M., and Vidal, F. P., “Simulation of x-ray projections on gpu: Benchmarking gvirtualxray with clinically realistic phantoms,” Computer Methods and Programs in Biomedicine 234, 107500 (2023). DOI: 10.1016/j.cmpb.2023.107500
  • Review paper on CT applications: Vidal, F. P., Afshari, S., Ahmed, S., Atkins, C. Béchet, E., Bellot, A., Bosse, S., Chahid, Y., Chou, C.-Y., Culver, R., Dixon, L., Friemann, J., Garbout, A., Hatton, C., Henry, A., Leblanc, C., Leonardi, A., Létang, J. M., Lipscomb, H., Manchester, T., Meere, B., Middleburgh, S., Mitchell, I., Perera, L., Puig, M., and Tugwell-Allsup, J., “X-ray simulations with gVXR as a useful tool for education, data analysis, set-up of CT scans, and scanner development,” in Developments in X-Ray Tomography XV, SPIE Optics & Photonics, Volume 13152, SPIE, San Diego, California, United States (Aug 2024). DOI: 10.1117/12.3025315

User contributions on our website

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

About

Training material on gVXR

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •