Examples#

Each page has the commands, an explanation and one result figure. Figure captions state the data and settings. The scripts are in the examples/ directory of a source checkout; see the “From source” tab in Installation.

Analytical reconstruction#

Iterative reconstruction#

Clinical data and detectors#

  • Clinical helical CT: measured patient projections, flying focal spot, curved detector, 8 GPUs.

  • Mayo public datasets: discovery, loading and Hounsfield calibration for the Mayo 2020 and 2016 patient data.

  • Curved detector: projection, matched adjoint and gradients on a native cylindrical detector.

All scripts#

The scripts in the repository examples/ directory show how to use diffct. Run them from the repository root.

  • quickstart.py: Projector basics for parallel, fan and cone beams, with the adjoint check and gradients.

  • curved_detector.py: native cylindrical cone detector projection, matched backprojection, adjoint check and volume/surface gradients on a circular scan.

  • chunked_reconstruction.py: CPU-backed CGLS with automatic CUDA tiles, optional manual limits and measured peak allocation; see Large Volumes and Chunked Execution.

  • disk_reconstruction.py: blockwise disk CGLS, optional native curves, rank-owned spatial slabs and completed-iteration checkpoints.

  • benchmark_execution.py: schedule and slab/block comparisons with actual copy payloads, pilot metadata, timing and CUDA tensor peaks.

  • benchmark_trajectory_admission.py: per-call trajectory validation without numerical projection. Use --backend torch --frame-device cpu on CPU.

  • benchmark_surface_geometry.py: forward, adjoint and geometry-gradient timings of both curved-detector interfaces on a synthetic helical scan.

  • benchmark_gpu_overheads.py: synthetic launch and transfer overheads of trajectories, detector surfaces, solvers and tiled FDK.

  • analytical_reconstruction.py: parallel-beam FBP, fan-beam FBP and cone-beam FDK, with a choice of ramp-filter window.

  • learnable_reconstruction.py: build and train a filter and detector weights for parallel/fan FBP or cone FDK using public helpers.

  • helical_fdk.py: approximate axial helical FDK with explicit slice windows and weight gradients.

  • iterative_reconstruction.py: 3D cone-beam CGLS, SIRT and TV reconstruction on circular, helical, saddle or sinusoidal trajectories.

  • walnut_reconstruction.py: FDK, SIRT, CGLS and TV reconstruction of a measured walnut scan.

  • geometry_calibration.py: recovers per-view angle errors and a detector shift from projections, using geometry gradients.

  • benchmark_projector.py: compares one GPU with several GPUs.

  • benchmark_scaling.py: measures the 512³ README workload on 1, 4 and 8 GPUs, with raw timings and numerical checks.

  • plot_trajectory.py: plots the trajectory generators (CPU only).

See examples/README.md in the repository for all launch modes.

Data sources#

The figures are made by docs/assets/gallery/compute.py and docs/assets/gallery/render.py; see docs/assets/gallery/NOTICE.