patminton — GPU-Accelerated 3D Photoacoustic Tomography
CUDA implementations of the forward and adjoint operators of 3D photoacoustic tomography (PAT) as on-the-fly matrix-vector products, for iterative image reconstruction without storing the system matrix, plus CGLS, L-BFGS-B, PGD and Chambolle-Pock TV solvers built on top of them.
For a 201³ grid observed by 11 520 transducer positions with 1000 time samples,
the dense system matrix would occupy 201³ × 11 520 × 1000 × 8 B ≈ 750 TB in double
precision; patminton applies it and its adjoint on the fly on the GPU instead.
Installation
pip install patminton
Requirements: an NVIDIA GPU (compute capability ≥ 7.5, driver ≥ 580) and
Python ≥ 3.9. On Linux x86-64 this installs a prebuilt CUDA 13 wheel and
needs no CUDA toolkit; if cuFFT is not already provided by a toolkit or by
PyTorch (e.g. with a CUDA 12 build of PyTorch), use
pip install patminton[cuda13].
Installing from source instead requires the CUDA toolkit (nvcc ≥ 11 on
PATH), which compiles the library for every supported architecture. To target
a specific set of GPUs (e.g. V100 + A100 + RTX 30xx, with a CUDA 12 toolkit):
PATMINTON_CUDA_ARCH="70;80;86" pip install --no-binary patminton patminton
Quick example
import torch
from patminton import PAT, translation_rotation_system, least_squares_CG
infos = translation_rotation_system(
transducer_radius=25e-3, transducer_height=7.5e-3,
transducer_width=0.250e-3, transducer_pitch=0.298e-3,
transducer_nbr_elements=64, transducer_wavelength=1500/5e6,
grid_size=10e-3,
)
pat = PAT(201, 201, 201, 5e-3, 5e-3, 5e-3,
nT=1024, tStart=12.5e-6, dt=16e-9, c=1500.0,
mode='cylinder_lut', infos_transducers=infos)
p = torch.zeros((201, 201, 201), dtype=torch.float64, device='cuda')
p[100, 100, 100] = 1.0
s = pat @ p # forward: signals from initial pressure
p_bp = pat.T @ s # adjoint: back-propagation
u, *_ = least_squares_CG(pat, s, M_inv=None, max_iter=50, lam=1e-4)
Documentation
patminton.readthedocs.io — installation, quickstart, physical and mathematical model, transducer models, reconstruction algorithms and key parameters.
To preview it locally:
pip install -r docs/requirements.txt
mkdocs serve # live preview on http://127.0.0.1:8000
Tests
pip install .[test]
pytest # CPU tests (no GPU needed)
pytest -m gpu # operator tests on a CUDA GPU
Reference
The on-the-fly matrix-vector product strategy follows:
Lu Ding, Daniel Razansky, Xosé Luís Deán-Ben — "Model-based reconstruction of large three-dimensional optoacoustic datasets", IEEE Transactions on Medical Imaging, 2020.
If you use this package, please cite:
Trung-Thai Do, Paul Escande, Caroline Chaux, Jérôme Gateau, Hwee Kuan Lee — "Implementations of photoacoustic tomography models", 2026.
Metadata
Release files for patminton 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| patminton-0.1.0.tar.gz | 57.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| patminton-0.1.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details |
Total release size: 4.9 MB
Release files / patminton-0.1.0.tar.gz
| Download URL | patminton-0.1.0.tar.gz |
|---|---|
| Size | 57.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cdb05dccc9dbfa4668368032c80f7229a8c80fd9e795412a1db3d8333375367
|
|
BLAKE2b-256 checksum How to use checksums |
7e8d0c4711d5318bc5146398fa7fb46800b8f8d23ae1c769409ea80f35ec949b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / patminton-0.1.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | patminton-0.1.0-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
2127949691b13358813b769828a68e1a0487f8b7b5d4bb07acb16cfa94e0462e
|
|
BLAKE2b-256 checksum How to use checksums |
1d45e62d8d4160b0f0527122c7cbbe469c1127ae41d3f96813217d60aa47c96d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency log