virtRTG is a pyDpVision plugin for transformation-driven generation of
comparable synthetic projection images from multimodal anatomical scenes.
The plugin enables projection imaging from independently transformable volumetric and surface-based objects represented within a common scene hierarchy. It is intended primarily for research, prototyping, and technical experimentation involving VirtualRTG generation, anatomical motion analysis, and comparable projection imaging scenarios.
The methodological foundations of virtRTG are described in the manuscript:
Pojda D., Domino K., Tarnawski M., Tomaka A.A. "Transformation-driven generation of comparable projection images from multimodal anatomical scenes"
currently under peer-review.
A DOI and full citation will be added after publication.
The plugin is usable as an experimental RTG workflow inside pyDpVision, but it
should not be treated as a clinical, regulatory, or production-grade radiography
simulator.
What is already strong:
- flexible detector and source geometry,
- support for cone-beam and parallel-beam projection,
- hybrid scene handling for volumes and meshes,
- multiple presentation modes for the final image,
- plugin-local numeric tests for key backend components,
- explicit attribution notes for major algorithmic references.
What is still evolving:
- the physics model is simplified and partly heuristic,
- some mesh backends are still exploratory,
- GUI and OpenGL paths are not the main target of automated testing,
- standalone packaging outside
pyDpVisionhas not been completed yet.
Unlike conventional DRR pipelines that typically operate on a fixed volumetric dataset, virtRTG treats projection generation as an observation process applied to a transformation-aware scene.
A scene may contain:
- CT or CBCT volumes,
- segmented anatomical structures,
- surface meshes,
- dental scans,
- treatment-related objects,
- anatomical landmarks and trajectories.
All scene entities may remain independently transformable and are propagated directly into projection space through explicit transformations during image generation.
This design allows generation of multiple directly comparable projection images from alternative anatomical configurations while preserving identical imaging conditions.
- detector geometry built from center, normal, and up vectors,
- configurable detector resolution and pixel pitch,
- cone-beam and parallel-beam projection modes,
- optional depth-window clipping,
- reusable quality profiles for draft and higher-quality runs,
- JSON-based geometry presets.
- volumetric X-ray source with interpolated sampling,
- optional Siddon-style exact voxel traversal for volume integration,
- mesh X-ray source with analytic ray-triangle intersection,
- projected mesh intersection backend for detector-space experiments,
- per-source scaling and attenuation controls.
- CT-like scalar-to-attenuation mapping,
- Beer-Lambert style intensity conversion,
- optional heuristic energy and distance falloff terms,
- raw, digital radiography, and film-like presentation models,
- robust percentile normalization, contrast, gamma, inversion, and windowing.
- independently transformable anatomical objects,
- projection generation from multimodal scene hierarchies,
- support for alternative anatomical configurations,
- motion-dependent projection scenarios,
- mandibular-motion and TMJ-oriented experimentation,
- propagation of landmarks and annotations into projection space.
VirtualXRayscene object integrated into thepyDpVisionobject tree,- Qt property panel for interactive setup and simulation,
- projected annotation overlays,
- PNG, TIFF, and DICOM export helpers,
- synthetic demos and benchmark helpers.
Within pyDpVision, a typical workflow looks like this:
- Load or create one or more
VolumetricorMeshobjects. - Create a
VirtualXRayobject from the plugin menu. - Choose a preset or define detector/source geometry manually.
- Tune sampling, source handling, physics, and presentation parameters.
- Run the projection.
- Inspect the result in the workspace or export it to file.
In practice, the central user-facing object is VirtualXRay, while the heavy
computation lives in the backend modules under xray/.
The plugin is loaded by the host application during startup.
Run the application from the project root:
python main.pyThen, inside the application:
- Open or import scene data.
- Go to the plugin menu and create a new RTG object.
- Select the created
VirtualXRayobject in the workspace. - Use the property panel to configure geometry and run the simulation.
The plugin is split into a small number of responsibility layers.
pluginMain.py- plugin registration, menu integration, property-panel hookup,
virtualXRay.py- scene-tree object coordinating geometry, source discovery, backend configuration, caching, and visual integration with the host scene.
gui/propVirtualXRay.py- interactive Qt property panel for configuring and running the RTG workflow.
xray/xrayProjection.py- geometry, clipping, physics, projector logic, scene-level projection API,
xray/xraySource.py- volumetric and mesh source backends,
xray/xrayPresentation.py- final image presentation models,
xray/xrayAnnotationOverlay.py- annotation projection and 2D overlay primitives,
xray/xrayHelpers.py- shared transform and math helpers.
presets/xray_geometry_presets.json- editable geometry presets,
docs/THIRD_PARTY_ATTRIBUTION.md- algorithmic attribution notes,
benchmark.py- demo data generation and performance helpers.
plugins/virtRTG/
pluginMain.py
virtualXRay.py
benchmark.py
gui/
propVirtualXRay.py
xray/
xrayProjection.py
xraySource.py
xrayPresentation.py
xrayAnnotationOverlay.py
xrayHelpers.py
presets/
xray_geometry_presets.json
docs/
THIRD_PARTY_ATTRIBUTION.md
tests/
README.md
The plugin has a local pytest scaffold in tests/, focused on the pure numeric
backend under xray/.
Currently covered:
- geometry helpers,
- clipping helpers,
- scalar preprocessing and physics response,
- presentation models,
- additional backend-oriented helper coverage as the suite grows.
Current test philosophy:
- prioritize deterministic numeric behavior,
- avoid coupling basic unit tests to Qt and OpenGL,
- keep backend tests close to the plugin so they can move with it if it becomes a standalone repository.
See tests/README.md for details on the current scaffold and next planned cases.
This plugin is intended as a methodological and experimental environment rather than a physically faithful radiographic simulator.
- The attenuation model is simplified and should be treated as approximate.
- Material-response modes are useful for experimentation, not validated imaging physics.
- Presentation models are image-generation layers, not calibrated detector models.
- Some advanced mesh workflows remain sensitive to source topology and scene setup.
- Host-side integration still assumes the
pyDpVisionapplication lifecycle.
- attribution and algorithm notes: docs/THIRD_PARTY_ATTRIBUTION.md
- test scaffold notes: tests/README.md
Reasonable next steps for the plugin itself:
- strengthen source-backend tests with synthetic
VolumetricandMeshfixtures - add more lightweight end-to-end backend projection tests
- reduce host-specific assumptions around plugin loading and global state
- document a backend-only usage path outside the GUI
- separate experimental backends more clearly from the default workflow
- improve standalone readiness if the plugin is moved into its own repository
- investigate GPU acceleration backends
- support richer transformation-driven motion scenarios
- extend physical modelling with optional scattering and detector effects
- improve standalone reproducibility outside pyDpVision