tomoxide

A Rust tomographic reconstruction toolkit — the algorithmic breadth of tomopy fused with the GPU-accelerated streaming reconstruction of tomocupy, behind a single tri-backend abstraction: CPU · CUDA · wgpu (Metal / Vulkan / DX12).

crates.io docs.rs GitHub

All three backends reconstruct real beamline datasets. The CPU backend ports tomopy's analytic (fbp, gridrec, fourierrec, lprec, linerec) and iterative (sirt, mlem, osem, ospml, pml, tv, grad, tikh, art, bart) families; the CUDA backend ports tomocupy's device-resident streaming kernels (multi-GPU, fp16, laminography, and the full iterative suite on-device); the wgpu backend runs a portable subset with no NVIDIA toolkit.

Why

tomopytomocupytomoxide
LanguagePython + C (libtomo)Python + CUDA (CuPy)Rust
Algorithm breadth✅ broad⚠️ fourierrec/lprec/linerec✅ union of both
GPU acceleration⚠️ partial✅ CUDA streaming✅ CUDA + portable wgpu
Streaming / on-the-fly❌✅ chunked, double-buffered✅ (port of rec_steps)
Memory safetyCCUDA/C++✅ Rust
Runs without an NVIDIA GPU✅ (CPU)❌✅ (CPU or Metal via wgpu)

Install

The library and CLI are published on crates.io:

# Library — add to a Rust project
cargo add tomoxide

# Command-line reconstruction tool
cargo install tomoxide-cli

The default build is pure-CPU with no system dependencies. Opt into the GPU backends and extras with cargo features:

# CUDA backend (needs the CUDA toolkit / nvcc)
cargo add tomoxide --features cuda

# Portable GPU backend (wgpu: Metal / Vulkan / DX12)
cargo add tomoxide --features gpu-wgpu

Other features: config (TOML recipes, shared by the CLI and GUI), beam-hardening (xraylib), sift-center (pure-Rust SIFT center finding).

Workspace layout

Two published crates plus a desktop GUI that lives in the repo but outside the Cargo workspace:

crates/
  tomoxide       library: data model, geometry, the Backend trait, all three
                 backends, reconstruction, preprocessing, I/O, simulation,
                 and the high-level streaming pipelines
  tomoxide-cli   command-line front-end (init / status / recon / recon_steps / tune_chunk)
  tomoxide-gui   desktop app (rsplot / egui + wgpu) — not published to crates.io

This book

  • Architecture — the Backend trait, the tri-backend design, threading, and the streaming pipelines.
  • Algorithms — the analytic and iterative reconstruction families and their filters, geometry, and conventions.
  • Benchmarks — cross-backend timing and accuracy, including FBP-vs-iterative comparisons against known-truth phantoms.
  • Desktop GUI — the six-mode tomoxide-gui (Data / Tune / Center / Run / Output / Live) and its offline + live-streaming design.
  • Porting & tomocupy parity — how the CUDA/CPU backends were ported and validated against the upstream tomopy / tomocupy originals.

The full API reference is on docs.rs/tomoxide.

License

See the repository for license details.