lightniing Projects About Source
All projects

Diffusion Imaging

lightniing accelerates diffusion MRI processing and tractography across CUDA, Metal, and WebGPU.

WebGPUMetalstreamlines

Diffusion processing

Diffusion MRI preprocessing is computationally intensive. DiffusionBench demonstrates a representative workflow built from FSL tools. Several stages—including MMORF, probtrackx2_gpu, bedpostx_gpu, and eddy_cuda—provide CUDA implementations and therefore perform best on NVIDIA GPUs. Without a compatible NVIDIA GPU, these operations can be more than an order of magnitude slower.

The lightniing team has optimized these tools to run up to twice as fast on NVIDIA GPUs and added Metal implementations for Apple silicon. Many FSL tools divide computation between the CPU and GPU rather than running entirely on the GPU. Apple’s unified-memory architecture allows both processors to access the same memory, avoiding transfers between separate CPU and GPU memory pools. Download our optimized version from Github.

Diffusion processingOptimized tools reduce total run time (shorter bars are faster) Diffusion processingOptimized tools reduce total run time (shorter bars are faster)MacBookk M5 Max (Metal)DGX SparkDGX Spark (optimized)AMD 7995wx RTX4090AMD 7995wx RTX4090 (optimized)
Illustrative Diffusion Imaging benchmark figure

Benchmark source

Streamline generation

DIPY GPUStreamlines generates tractography streamlines from voxelwise diffusion models. Its original CPU and CUDA backends provide substantial acceleration on NVIDIA hardware. lightniing extends GPUStreamlines with Metal support for Apple hardware and WebGPU support across modern GPU vendors and browsers. The browser demonstration provides a local, drag-and-drop workflow that processes diffusion data within the browser.

Diffusion tractography streamlines passing through an anatomical brain model
Diffusion tractography streamlines passing through an anatomical brain model
Streamline GenerationAcceleration provided by GPU relative to CPU Streamline GenerationAcceleration provided by GPU relative to CPUCPULinux WebGPU41×Mac WebGPU47×Mac Metal95×Linux CUDA273×
Illustrative Diffusion Imaging benchmark figure

Benchmark source

References

  • Lange et al. (2024) introduce MMORF.
  • Garyfallidis et al. (2014) describe the DIPY software library.
  • Hernández-Fernández et al. (2013) introduce GPU acceleration for FSL BedpostX.
  • Hernández-Fernández et al. (2019) describe GPU-accelerated FSL ProbtrackX.
  • Andersson et al. (2003) describe the basis of FSL TOPUP.
  • Andersson and Sotiropoulos (2016) describe the framework used by FSL EDDY.