Open Source · MITSimulation + Reconstruction

Polychromatic CT, end-to-end, on every GPU.

BasisSimulator.jl is an open-source polychromatic CT simulator and reconstructor. From source spectrum through Beer-Lambert forward projection to FBP, Hybrid IR, and material-basis VMI — covering both energy-integrating and CdTe photon-counting detectors. The same source tree runs on Metal, CUDA, ROCm, and CPU.

Open
Source
Gammex Model 472 phantomStandard-dose sinogram (central detector row)Standard vs low-dose reconstruction, raw vs corrected
02
Detector
Physics
03
Recon
Pipelines
04
GPU
Backends
05
Composable
Structs
§ 02  The Workflow

Phantom → sinogram → image,
in five structs.

Allocate a workspace once. Reuse it on every subsequent call. Forward projection, noise model, and reconstruction are all GPU-resident and zero-allocation in steady state.

import BasisSimulator as BS
using Metal  # or CUDA / AMDGPU; omit for CPU

# 1. Phantom — labeled mask + materials dict + voxel size
phantom_cpu = BS.create_gammex_472(n_voxels=256)
phantom = BS.Phantom(MtlArray(phantom_cpu.mask),
                     phantom_cpu.materials,
                     phantom_cpu.voxel_size)

# 2-5. Scanner / Protocol / SimOptions / ReconOptions
scanner  = BS.Scanner(source_to_isocenter=626.0, source_to_detector=1097.0)
protocol = BS.CTProtocol(kVp=120.0, mA=200.0, views=984)
sim_opts = BS.SimOptions(fidelity=:eict)              # or :pcct
rec_opts = BS.ReconOptions(matrix_size=(512, 512, 64), fov_cm=35.0)

# Allocate workspace once, reuse on subsequent calls (zero-alloc steady state)
ws = BS.create_eict_workspace(scanner, protocol, sim_opts, rec_opts, phantom)
BS.simulate!(ws, phantom, scanner, protocol, sim_opts, rec_opts)

# Reconstruct → Hounsfield units
ws_fdk = BS.create_fdk_recon_workspace(ws.sino_noisy_out, ws.geom, rec_opts.matrix_size)
hu = BS.to_hounsfield(
    Array(BS.reconstruct!(ws_fdk, ws.sino_noisy_out, ws.geom, rec_opts.matrix_size));
    μ_water = BS.get_reference_μ_water(70.0),
)
§ 03  What's inside

Three pillars,
one package.

End-to-end means simulation physics, reconstruction algorithms, and hardware backends — all under one roof, all GPU-portable.

Physics

Polychromatic & Spectral

Beer-Lambert across the full source spectrum. Energy-integrating detection or CdTe photon-counting with Koch-Mehrin charge transport, K-fluorescence, pileup, and an MC-derived DRM.

Reconstruction

FBP · IR · VMI

FBP (FDK), Hybrid Iterative Reconstruction (PWLS + Huber), and material-basis Virtual Monoenergetic Imaging — all GPU-resident with a zero-allocation workspace pattern.

Portability

Backend-Agnostic GPU

Backend-agnostic via AcceleratedKernels.jl — Metal (Apple Silicon), CUDA (NVIDIA), ROCm (AMD), or CPU from the same Julia source. No vendor-specific kernels to maintain.