gVirtualXRay: Virtual X-Ray Imaging Library on GPU


After an intance Summer of coding, a new version is coming soon... A better integration of all the dependencies using CMake, more tutorials, new examples, support of FLTK, Qt4, Qt5, FreeGLUT, and GLFW.


This project is focused on developing new software technologies for simulating X-ray images on the graphics processor unit (GPU) using OpenGL. It supports ‘old’ OpenGL implementation as well as modern OpenGL core profile (OpenGL 3.2+). No deprecated function in OpenGL has been used. The library takes care of matrix transformations, matrix stacks, etc.

The source code of gVirtualXRay’s is available under the BSD 3-Clause License. For details on use and redistribution please refer to http://opensource.org/licenses/BSD-3-Clause.

gVirtualXRay has been successfully tested on the following platforms (compilers):

It should be possible to build it on other platforms, but this has not been tested.

gVirtualXRay has been successfully tested on the following platforms (graphics card):

It should be possible to run it on other platforms, but this has not been tested.


Details about (most of) the methods used and implemented in gVirtualXRay can be found in these papers:

F. P. Vidal, and P.-F. Villard. Development and validation of real-time simulation of X-ray imaging with respiratory motion. Computerized Medical Imaging and Graphics, 49:1-15, April 2016.  BibTeX   DOI   PMID   PDF 

Abstract: We present a framework that combines evolutionary optimisation, soft tissue modelling and ray tracing on GPU to simultaneously compute the respiratory motion and X-ray imaging in real-time. Our aim is to provide validated building blocks with high fidelity to closely match both the human physiology and the physics of X-rays. A CPU-based set of algorithms is presented to model organ behaviours during respiration. Soft tissue deformation is computed with an extension of the Chain Mail method. Rigid elements move according to kinematic laws. A GPU-based surface rendering method is proposed to compute the X-ray image using the Beer-Lambert law. It is provided as an open-source library. A quantitative validation study is provided to objectively assess the accuracy of both components: (i) the respiration against anatomical data, and (ii) the X-ray against the Beer-Lambert law and the results of Monte Carlo simulations. Our implementation can be used in various applications, such as interactive medical virtual environment to train percutaneous transhepatic cholangiography in interventional radiology, 2D/3D registration, computation of digitally reconstructed radiograph, simulation of 4D sinograms to test tomography reconstruction tools.

Keywords: Deterministic simulation (ray-tracing); Digitally reconstructed radiograph; Imaging guidance; Interventional radiology training; Medical virtual environment; Respiration simulation; X-ray simulation

There are other scientific papers of interest. For more details, visit our publication page.