A CUDA-based library for computed tomography (CT) projection and reconstruction with differentiable operators
Project description
diffct: Differentiable Computed Tomography Operators
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!
๐ Branches
Main Branch (Stable)
This is the stable version supporting circular trajectory CT reconstruction.
Dev Branch (Under Development)
The dev branch includes experimental features:
- Random trajectory projection and backprojection operators
- New examples with non-circular trajectories
โ ๏ธ Note: The dev branch is under active development. If you find any bugs, please raise an issue.
โจ Features
- Fast: CUDA-accelerated projection and backprojection operations
- Differentiable: End-to-end gradient propagation for deep learning workflows
๐ Supported Geometries
- Parallel Beam: 2D parallel-beam geometry
- Fan Beam: 2D fan-beam geometry
- Cone Beam: 3D cone-beam geometry
๐งฉ Code Structure
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 # Dependencies
๐ Quick Start
Prerequisites
Installation
CUDA 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 diffct
CUDA 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 diffct
CUDA 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 diffct
๐ Citation
If 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}
}
๐ License
This project is licensed under the Apache 2.0 - see the LICENSE file for details.
๐ Acknowledgements
This project was highly inspired by:
Issues and contributions are welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diffct-1.2.9.tar.gz.
File metadata
- Download URL: diffct-1.2.9.tar.gz
- Upload date:
- Size: 39.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
298a9af712e1e993a4924edef9a6dfcc6a74a49bacc13fd6e22a8ffe546109ca
|
|
| MD5 |
02104c0e53cc035c1acd4fb61f788a80
|
|
| BLAKE2b-256 |
b4f7213f822673f85f66bd4e79eb0e4b8c74666fb44c9913a451ea8b67f22dc1
|
File details
Details for the file diffct-1.2.9-py2.py3-none-any.whl.
File metadata
- Download URL: diffct-1.2.9-py2.py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e2ab014d3af60e8bae6d013aa79c1d9f46dd9fe0135656a10a2973f5b3f1eee
|
|
| MD5 |
37f31c285d29d851771ce5e65b672988
|
|
| BLAKE2b-256 |
067f5ed4017003a11cda606f3479a8233b86745e7ea960488fc455f07ba76ad6
|