How bu-cisl/wgpu-idt works
The product is a browser-based WebGPU framework for intensity diffraction tomography. Its main workflow takes a user-supplied volume and imaging parameters, runs a selected C++ forward model on the GPU, and presents or exports the simulated result. The repository also includes an SSNP reconstruction path and shared GPU compute utilities. The README documents frontend/backend handoffs; source excerpts and the SOURCE INDEX support the backend relationships shown. Unsampled frontend and model internals are represented at subsystem level where their exact call wiring is not visible.
Main entry points: pipeline.cpp SSNP propagation pipeline · main.cpp WASM interface · model_dispatcher.cpp Model dispatcher · simulation.js Simulation coordinator
Components 20
Browser interface
- Volume and controls
web/js/file-handlers.js - Input processing
web/js/file-processing.js - Simulation coordinator
web/js/simulation.js - Results display
web/js/visualization.js
Runtime entry
- WASM interface
src/main.cpp - Tensor file I/O
src/utils/testing_io.cpp - Model dispatcher
src/model_dispatcher.cpp
Forward models
- Born propagation
src/born/forward.cpp - BPM propagation
src/bpm/forward.cpp - SSNP forward
src/ssnp/forward.cpp - SSNP propagation pipeline
src/ssnp/pipeline.cpp
SSNP reconstruction
- SSNP reconstruction
src/ssnp/inverse.h - Reconstruction gradients
src/ssnp/volume_grad/volume_grad.cpp
GPU compute foundation
- WebGPU context and buffers
src/common/webgpu_utils.cpp - FFT transforms
src/common/fft/fft.cpp - DFT transforms
src/common/dft/dft.cpp - Pupil filtering
src/common/binary_pupil/binary_pupil.cpp - Intensity output
src/common/intensity/intensity.cpp - Illumination tilt
src/common/tilt/tilt.cpp
Other components
- User
Connections 21
- User → Volume and controls: selects inputs
README.md - Volume and controls → Input processing: passes volume
README.md - Input processing → Simulation coordinator: prepares input
README.md - Simulation coordinator → WASM interface: invokes backend
README.md - WASM interface → Model dispatcher: dispatches model
src/main.cpp - WASM interface → Tensor file I/O: reads and writes
src/main.cpp - Model dispatcher → Born propagation: selects model
- Model dispatcher → BPM propagation: selects model
- Model dispatcher → SSNP forward: selects model
- WASM interface → SSNP reconstruction: runs reconstruction
src/main.cpp - SSNP forward → SSNP propagation pipeline: uses pipeline
- SSNP propagation pipeline → FFT transforms: runs transforms
src/ssnp/pipeline.cpp - SSNP propagation pipeline → Pupil filtering: filters field
src/ssnp/pipeline.cpp - SSNP propagation pipeline → Illumination tilt: initializes field
src/ssnp/pipeline.cpp - SSNP propagation pipeline → WebGPU context and buffers: creates buffers
src/ssnp/pipeline.cpp - FFT transforms → DFT transforms: uses fallback
src/common/fft/fft.cpp - SSNP reconstruction → Reconstruction gradients: uses gradients
src/ssnp/inverse.h - SSNP reconstruction → SSNP propagation pipeline: uses forward pipeline
src/ssnp/inverse.h - Simulation coordinator → Results display: displays results
README.md - WASM interface → Results display: sends plotted output
src/main.cpp - Results display → User: shows measurements
README.md