Skip to main content

A CUDA-based library for computed tomography (CT) projection and reconstruction with differentiable operators

Project description

diffct: Differentiable Computed Tomography Operators

License DOI PyPI version Documentation CI/CD Ask DeepWiki

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!

โœจ 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:

# Create and activate conda environment
conda create -n diffct python=3.12
conda activate diffct

# Install CUDA Toolkit, PyTorch, and Numba
conda install nvidia/label/cuda-12.8.1::cuda-toolkit
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
pip install numba-cuda[cu12]

# Install diffct
pip install diffct

CUDA 11:

# Create and activate conda environment
conda create -n diffct python=3.12
conda activate diffct

# Install CUDA Toolkit, PyTorch, and Numba
conda install nvidia/label/cuda-11.8.0::cuda-toolkit
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffct-1.2.7.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffct-1.2.7-py2.py3-none-any.whl (20.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file diffct-1.2.7.tar.gz.

File metadata

  • Download URL: diffct-1.2.7.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for diffct-1.2.7.tar.gz
Algorithm Hash digest
SHA256 38f9f0882f0e0352dfba1970b5677fdc2ede87e0b424a742c32c68875333ec24
MD5 d19889b5ff544f58a12ad2c0bc6bdcbf
BLAKE2b-256 99e22fb5ccdfd193efa88000b66f35999c8702c3e731c9c3f02cf2f3582871a7

See more details on using hashes here.

File details

Details for the file diffct-1.2.7-py2.py3-none-any.whl.

File metadata

  • Download URL: diffct-1.2.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for diffct-1.2.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b6986582f7daaea38006eff79940adccd63151018b97dcfda01cfe0da12f902d
MD5 5c0dac341d9c072aaa3091071f493ee4
BLAKE2b-256 836fa795f4ac2b4970f94ae468fbbe4529fbdb7e8918531383966fa179ebd114

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page