A high-performance, CUDA-accelerated library for circular orbits CT reconstruction with end-to-end differentiable operators, enabling advanced optimization and deep learning integration.
β Please star this project if you find it is useful!
This is the stable version supporting circular trajectory CT reconstruction.
The dev branch includes experimental features:
- Random trajectory projection and backprojection operators
- New examples with non-circular trajectories
- Fast: CUDA-accelerated projection and backprojection operations
- Differentiable: End-to-end gradient propagation for deep learning workflows
- Parallel Beam: 2D parallel-beam geometry
- Fan Beam: 2D fan-beam geometry
- Cone Beam: 3D cone-beam geometry
diffct/
βββ diffct/
β βββ __init__.py # Package initialization
β βββ differentiable.py # Differentiable CT operators
βββ examples/ # Example usages
β βββ fbp_parallel.py
β βββ fbp_fan.py
β βββ fdk_cone.py
β βββ iterative_reco_cone.py
β βββ iterative_reco_fan.py
β βββ iterative_reco_parallel.py
βββ pyproject.toml # Project metadata
βββ README.md # README
βββ LICENSE # License
βββ requirements.txt # DependenciesCUDA 12 (Recommended):
# Create and activate conda environment
conda create -n diffct python=3.12
conda activate diffct
# Install CUDA (here 12.8.1 as example) PyTorch, and Numba
conda install nvidia/label/cuda-12.8.1::cuda-toolkit
# Install Pytorch, you can find the commend here: https://pytorch.org/get-started/locally/
# Install Numba with CUDA 12
pip install numba-cuda[cu12]
# Install diffct
pip install diffctCUDA 13 Installation
# Create and activate conda environment
conda create -n diffct python=3.12
conda activate diffct
# Install CUDA (here 13.0.2 as example) PyTorch, and Numba
conda install nvidia/label/cuda-13.0.2::cuda-toolkit
# Install Pytorch, you can find the commend here: https://pytorch.org/get-started/locally/
# Install Numba with CUDA 13
pip install numba-cuda[cu13]
# Install diffct
pip install diffctCUDA 11 Installation
# Create and activate conda environment
conda create -n diffct python=3.12
conda activate diffct
# Install CUDA (here 11.8.0 as example) PyTorch, and Numba
conda install nvidia/label/cuda-11.8.0::cuda-toolkit
# Install Pytorch, you can find the commend here: https://pytorch.org/get-started/locally/
# Install Numba with CUDA 11
pip install numba-cuda[cu11]
# Install diffct
pip install diffctIf you use this library in your research, please cite:
@software{diffct2025,
author = {Yipeng Sun},
title = {diffct: Differentiable Computed Tomography
Reconstruction with CUDA},
year = 2025,
publisher = {Zenodo},
doi = {10.5281/zenodo.14999333},
url = {https://doi.org/10.5281/zenodo.14999333}
}This project is licensed under the Apache 2.0 - see the LICENSE file for details.
This project was highly inspired by:
Issues and contributions are welcome!