Examples¶
These galleries progress from PET scanner geometry and projectors, through iterative reconstruction algorithms (sinogram and listmode), to transmission and joint activity/attenuation (MLAA) reconstruction, and finally PyTorch integration. If you are new to parallelproj, read the Quickstart first, then work through the galleries roughly in numerical order.
Every example selects its array backend and device through the helper
suggest_array_backend_and_device from parallelproj._examples_utils – a
private, examples-only module shipped inside parallelproj – so the same code
runs on CPU or GPU with nothing extra to install or download.
PET scanner and sinogram geometry examples¶
These examples introduce the geometry objects that every projector is built from: cylindrical regular-polygon scanners and modular block scanners, how detector lines of response (LORs) map to sinogram bins, axial compression via the Michelogram (span and maximum ring difference), and sinogram symmetries. Start here to understand the building blocks used throughout the other galleries.
PET sinogram and listmode projector examples¶
Here you build projectors and run forward and back projections: non-TOF and TOF
sinogram projectors for cylindrical scanners, the equal-block projector for
modular scanners, the listmode projector, and the unlister that maps listmode
events to sinograms. These examples show the core proj(image) /
proj.adjoint(sinogram) interface that the reconstruction galleries rely on.
Non-TOF and TOF projections using a modularized (block) PET scanner geometry
Emission tomography reconstruction algorithms (sinogram data)¶
A tour of reconstruction algorithms for the (regularised) Poisson problem,
all built on the data-fidelity and prior objects in parallelproj.functions.
Start with the MLEM / OSEM / SVRG convergence comparison, then explore the
stochastic-gradient variants, PDHG / SPDHG with edge-preserving priors,
filtered back projection, De Pierro’s MAP-EM, the effect of TOF on variance,
and out-of-core (memory-mapped) OSEM.
Convergence comparison: SGD vs SVRG with logcosh regularization
PDHG and SPDHG for PET reconstruction with a directional TV prior
2D non-TOF filtered back projection (FBP) of Poisson data
DePierro’s algorithm to optimize the Poisson logL with quadratic intensity prior
TOF vs non-TOF: variance reduction in a uniform cylinder
Exact vs. “safe epsilon” mode of the negative Poisson log-likelihood
Emission tomography reconstruction algorithms (listmode data)¶
The same families of algorithms as the sinogram gallery, but operating directly on listmode (event-by-event) data through the listmode projector: listmode MLEM / OSEM / SVRG, stochastic-gradient variants, and listmode SPDHG. Listmode is the natural choice for sparse, high-resolution (e.g. TOF) data.
Convergence comparison: SGD vs SVRG with regularization (sinogram and listmode)
PDHG and LM-SPDHG to optimize the Poisson logL and total variation
Transmission and joint activity/attenuation (MLAA) examples¶
Reconstruction of the attenuation image from transmission data using the exact Poisson model (no log-linearisation) with a strictly positive scatter background: MLTR and separable paraboloidal surrogates (SPS), their ordered-subset and SVRG variants, and penalised transmission reconstruction (MAPTR) with an edge-preserving prior. The final example extends these ideas to joint activity-and-attenuation estimation (MLAA) from a single TOF emission scan.
Transmission reconstruction: MLTR, SPS and L-BFGS-B
Accelerating MLTR with ordered subsets (OS-MLTR) and SVRG
Penalised transmission reconstruction (MAPTR) with an edge-preserving prior
Joint activity and attenuation reconstruction (MLAA) for TOF PET
Custom parallelproj pytorch layer examples¶
How to wrap a parallelproj operator as a differentiable PyTorch layer, with an autograd-compatible forward and adjoint, so that projectors can be embedded in deep-learning reconstruction pipelines (e.g. unrolled / model-based networks).