gVirtualXray

Virtual X-Ray Imaging Library on GPU

Fully functional LabCT device in the Unreal Engine

Radiographer's interactive teaching tool

Tomography acquisition and reconstruction

Anatomical data

Spectral CT

Synchrotron μ-tomography with strong artefacts

Registration: X-ray projections

Registration: X-ray projections

Registration: CT reconstructions

Registration of a generic 3D hand model on a clinical 2D radiograph

Early Graphical User Interface (GUI) integration

What is it?

gVirtualXRay (gVXR) is a library to simulate X-ray imaging. It is based on the Beer-Lambert law to compute the absorption of light (i.e. photons) by 3D objects (here polygon meshes). It is implemented on the graphics processing unit (GPU) using the Shading Language (GLSL) .

SimpleGVXR is a smaller library build on the top of gVirtualXRay. It provides wrappers to , , , , , , and .

Supported platform

  • gVXR is cross-platform: it runs on ( only), ( & ), and MacOS computers ( only).
  • It supports GPUs from any manufacturer. It can even run on platforms without GPUs (in this case, be patient as the CPU will be used).
  • gVXR is scalable: it runs on
    • Raspberry Pi,
    • laptops,
    • desktop PCs,
    • supercomputers, and
    • cloud infrastructures, including:
  • Containerization using is even possible.

Main features

  • Validation:
    • Against VXI ;
    • Against Geant4 ;
    • Against experimental data .
  • Scanned object topology:
    • Surface meshes (triangles) in most popular file formats (e.g. STL, PLY, 3DS, OBJ, DXF, X3D, DAE);
    • Volume meshes (tetrahedrons) in the INP Abacus format but their support is experimental;
    • Built in phantoms (e.g. cubes, spheres, cylinders, foams, step wedges, Welch dragon, implicit modelling (soft objects and metaballs)).
  • Scanned object composition:
    • Mono-material;
    • Multi-material (note: there must be at least one mesh per material);
    • Chemical elements (e.g. the symbol `W' or the atomic number 74 for tungsten);
    • Compounds, e.g. H2O for water;
    • Mixtures, e.g. Titanium-aluminum-vanadium alloy, Ti90Al6V4;
    • Hounsfield units (for medical applications).
  • X-ray source:
    • Beam geometry:
      • Cone beam (both point sources and focal spots) to mimic X-ray tubes;
      • Parallel beam to mimic synchrotrons.
    • Beam spectrum:
      • Polychromatic to mimic X-ray tubes (note: when using the Python API, you can specify the tube voltage and the filtration);
      • Monochromatic to mimic synchrotrons.
      • Noiseless
      • Poisson noise (note: the photon flux must be specified)
  • X-ray detector:
    • Geometry:
      • Linear detectors;
      • Flat pannels.
    • Models:
      • Ideal detector;
      • Scintillation (note: the user can specify the thickness and material composition of the scintillator);
      • Point spread function (note: the level of blur inherent to the detector).
    • Types:
      • Energy integration;
      • Photon counting.
  • CT scanning geometry:
    • Standard orbital trajectories
    • Arbitrary trajectories
  • Misc:
    • Built in 3D visualisation

Who is it for?

gVXR is an application programming interface (API). It is for software developers who wish to simulate realistic X-ray images in realtime when photon scattering is negligible. gVXR's features can be used in C++, Python, R, Ruby, Tcl, C#, Java, and GNU Octave. To simplify the setting up of a simulation, a user-friendly JSON file format has been designed (note: for Python only at the moment).

If programming is not your thing, check out WebCT , a feature-rich environment for previewing and simulating X-ray scans on the web browser.

Join the community

gVXR is used in a wide range of applications, including real-time medical simulators, proposing a new densitometric radiographic modality in clinical imaging, studying noise removal techniques in fluoroscopy, teaching particle physics and x-ray imaging to undergraduate students in engineering, and XCT to masters students, predicting image quality and artifacts in material science, etc.

gVXR has also been used to produce a high number of realistic simulated images in optimization problems and to train machine learning algorithms. This paper presents applications of gVXR related to XCT.

Our community paper on "X-ray simulations with gVXR as a useful tool for education, data analysis, set-up of CT scans, and scanner development" was honoured with the Best Paper Award of the SPIE CT Conference 2024 for "tomography outreach tools".

Join the mailing list today

It only takes a minute to sign up. Our support team would be happy to help you.

How to find help

  • Email me (Franck P. Vidal, STFC);
  • Raise an issue on GitHub: ;
  • Open a ticket on SourceForge: ;
  • Use the forum on SourceForge: ;
  • Subscribe to the mailing list: ;
  • Check the technical documentation , or if you use Python call help(gvxr) for the package or something like help(gvxr.createNewContext) for a specific function.
  • Look at the cheat sheet that lists all the gVXR's functions used in the tutorial notebooks from the getting started section . It also includes the help messages to describe the purpose of each function.
  • Consult the FAQ section .

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: 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
  • 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
  • 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
  • Review paper on CT applications: F.P. Vidal, S. Afshari, S. Ahmed, C. Atkins, É. Béchet, A. Corbí Bellot, S. Bosse, Y. Chahid, C.-Y. Chou, R. Culver, L. Dixon, J. Friemann, A. Garbout, C. Hatton, A. Henry, C. Leblanc, A. Leonardi, J.M. Létang, H. Lipscom, T. Manchester, B. Meere, S. Middleburgh, I. Mitchell, L. Perera, M. Puig, and J. Tugwell-Allsup: X-ray simulations with gVXR as a useful tool for education, data analysis, set-up of CT scans, and scanner development Proceedings of SPIE Optics & Photonics, Developments in X-Ray Tomography XV, vol. 13152, International Society for Optics and Photonics, San Diego, USA (2024), doi: 10.1117/12.3025315

User contributions on our website

We'd like to share user contributions in the a applications section of the website. If you'd like to showcase your work, please contact me by email (Franck P. Vidal, STFC). Similarly, if you give a talk , publish some work or receive an award , let us know so that we can add the information in the corresponding section. If you added some code to gVXR, found a bug, etc. contact us by email or raise a ticket .