This repository contains a complete pipeline for generating EOS-like Digitally Reconstructed Radiographs (DRRs) from CT data with anatomical segmentation overlays. The tools simulate the imaging characteristics of EOS X-ray systems to create realistic 2D projections from 3D medical imaging data.
├── config.py # Configuration parameters and settings
├── data_processing.py # Data loading, resampling, and preprocessing
├── drr_generation.py # Core DRR generation and segmentation projection
├── image_enhancement.py # Histogram matching and image enhancement
├── scoliosis_simulation.py # Spine deformation simulation for data augmentation
├── file_io.py # File saving operations (PNG, NIFTI)
├── visualization.py # Display and visualization utilities
├── eos_drr_generator.py # Main pipeline orchestrator
├── requirements.txt # Package dependencies
└── README.md
pip install -r requirements.txt- Physics-based X-ray simulation using Beer-Lambert law
- Multi-view projections (coronal and sagittal)
- GPU acceleration for faster processing
- Scoliosis simulation for data augmentation
- Automatic histogram matching to reference EOS images
- Multi-channel segmentation projection
Place your data in the following directories:
- CT volumes:
../volumes/Thorax_N_volume.nii.gz - Segmentation masks:
../segmentations/Thorax_N.nii.gz
Configure processing options in config.py:
# Processing toggles
USE_BONE_SHARPENING = True
USE_HISTOGRAM_MATCHING = False
USE_SCATTER_SIMULATION = False
USE_SCOLIOSIS_SIMULATION = True
USE_VISUALISATION = True
USE_DOUBLE_AXIS_PROJECTION = True
# Projection parameters
FIRST_PROJECTION_AXIS = 1 # 0=axial, 1=coronal, 2=sagittal
SECOND_PROJECTION_AXIS = 2 # 0=axial, 1=coronal, 2=sagittalpython eos_drr_generator.pyoutput_folder/
├── drr/
│ ├── coronal/ # DRR images (16-bit PNG)
│ └── sagittal/
└── seg/
├── coronal/ # Segmentation projections (NIFTI)
└── sagittal/
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.