Skip to content

schaertim/DRR-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EOS-like DRR Generator

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.

Repository Structure

├── 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

Installation

pip install -r requirements.txt

Features

  • 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

Usage

Setup

Place your data in the following directories:

  • CT volumes: ../volumes/Thorax_N_volume.nii.gz
  • Segmentation masks: ../segmentations/Thorax_N.nii.gz

Configuration

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=sagittal

Running

python eos_drr_generator.py

Output Structure

output_folder/
├── drr/
│   ├── coronal/     # DRR images (16-bit PNG)
│   └── sagittal/    
└── seg/
    ├── coronal/     # Segmentation projections (NIFTI)
    └── sagittal/    

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages