![][julia-110] [![][gh-actions-komamri]][gh-actions-url] [![][buildkite-badge]][buildkite-url] [![][codecov-komamri]][codecov-url] [![][license]][license-url] [![][julia-blue]][julia-blue-url] [![][total-downloads-komamri]][downloads-komamri-url] ![][gh-starts-komamri]
[![][docr-img]][docr-url] [![][docd-img]][docd-url] [![][paper-img]][paper-url]
KomaMRI.jl is a Julia package for highly efficient β‘ MRI simulations. KomaMRI was built from the ground up to be: easy to use, extensible, cross-platform, and powered by open-source community standards.
|
Features: |
- Fast simulations with CPU/GPU parallelization ππ¨
- Extensible, so anyone can include new features π
- Supports community-standards [π€](## "Pulseq and ISMRMRD")
- Interactive visualizations using PlotlyJS.jl π²
- Cross-platform (Windows, Mac & Linux) π
- Friendly GUI (using web technologies) π
- Compatible with modern notebooks [π](## "Pluto and Jupyter")
- Flexible API for advanced users π¨βπ»
|
| **Packages** | **Stable Version** | **Build Status** | **Code Coverage** | **Downloads** |
|:------------------------------------------- |:---------------------------------------------|:--------------------------------------------|:--------------------------------------|:----------------------------------------------------|
| π¦ [KomaMRI.jl](## "User Interface") | [![][komamri-version]][komamri-juliahub] | [![][gh-actions-komamri]][gh-actions-url] | [![][codecov-komamri]][codecov-url] | [![][downloads-komamri]][downloads-komamri-url] |
| β π¦ [KomaMRIBase.jl](## "Custom Types") | [![][komabase-version]][komabase-juliahub] | [![][gh-actions-komabase]][gh-actions-url] | [![][codecov-komabase]][codecov-url] | [![][downloads-komabase]][downloads-komabase-url] |
| β π¦ [KomaMRICore.jl](## "Simulation") | [![][komacore-version]][komacore-juliahub] | [![][gh-actions-komacore]][gh-actions-url] | [![][codecov-komacore]][codecov-url] | [![][downloads-komacore]][downloads-komacore-url] |
| β π¦ [KomaMRIFiles.jl](## "Input/Output") | [![][komafiles-version]][komafiles-juliahub] | [![][gh-actions-komafiles]][gh-actions-url] | [![][codecov-komafiles]][codecov-url] | [![][downloads-komafiles]][downloads-komafiles-url] |
| β π¦ [KomaMRIPlots.jl](## "Plots") | [![][komaplots-version]][komaplots-juliahub] | [![][gh-actions-komaplots]][gh-actions-url] | [![][codecov-komaplots]][codecov-url] | [![][downloads-komaplots]][downloads-komaplots-url] |
Table of Contents
News
- (1 Oct 2024) KomaMRI v0.9: device-agnostic simulations, improved performance (4-5x faster and 80x less memory), distributed simulations, GPU benchmarking, mix-and-match motion definitions, improved dynamic phantom plotting, and a new phantom file format!
- (29 Aug 2024) Our first GSoC student, Ryan Kierulf, presented his fantastic work at the JuliaHealth monthly meeting π₯³! (presentation available here) More info in the docs: GPU Parallelization, Distributed Simulations and Ryan's JuliaHealth blog
- (7 Dec 2023) Koma was present in MRI Together πΌ. The talk is available here. Also, I uploaded the promised educational example.
- (17 Nov 2023) Pretty excited of being part of ISMRM Pulseq's virtual meeting. The slides available here.
- (27 Jul 2023) I gave a talk at MIT π for JuliaCon 2023! A video of the presentation can be seen here.
- (29 Jun 2023) KomaMRI.jl's paper was chosen as a July editor's pick in MRM π₯³!
- (6 Mar 2023) Paper published in MRM π!
- (8 Dec 2022) KomaMRI v0.7: improved performance (5x faster), type stability, extensibility, and more!
- (17 May 2022) ISMRM 2022 digital poster presented in London, UK. Recording here!. Name change MRIsim.jl -> KomaMRI.jl.
- (Aug 2020) Prehistoric version of Koma, MRIsim, presented as an ISMRM 2020 digital poster (virtual conference).
☰ Roadmap
v1.0:
- [x] Phantom and Sequence data types,
- [x] Spin precession in gradient-only blocks (simulation optimization),
- [x] GPU acceleration using CUDA.jl,
- [x] RF excitation,
- [x] GPU accelaration of RF excitation,
- [x] Scanner data-type: , etc.,
- [x] [Pulseq](https://github.com/imr-framework/pypulseq) IO,
- [x] Signal "Raw Output" dictionary ([ISMRMRD](https://ismrmrd.github.io/)),
- [x] [MRIReco.jl](https://magneticresonanceimaging.github.io/MRIReco.jl/latest/) for the reconstruciton,
- [ ] Documentation,
- [ ] [Auxiliary Pulseq functions](https://github.com/imr-framework/pypulseq/tree/master/pypulseq),
- [ ] Coil sensitivities,
- [ ] Cardiac phantoms and triggers.
- [ ] decay,
Next:
- [ ] Diffusion models with Laplacian Eigen Functions,
- [ ] Magnetic susceptibility,
- [ ] Use [PackageCompiler.jl](https://julialang.github.io/PackageCompiler.jl/dev/apps.html) to build a ditributable core or app.
Installation
To install, just type ] add KomaMRI
in the Julia REPL or copy-paste the following into the Julia REPL:
pkg> add KomaMRI
pkg> add CUDA # Optional: Install desired GPU backend (CUDA, AMDGPU, Metal, or oneAPI)
For more information about installation instructions, refer to the section Getting Started of the documentation.
First run
KomaMRI.jl features a convenient GUI with predefined simulation inputs (i.e. Sequence
, Phantom
, and Scanner
). To launch the GUI, use the following command:
using KomaMRI
using CUDA # Optional: Load GPU backend (default: CPU)
KomaUI()
Press the button that says "Simulate!" to do your first simulation :). Then, a notification will emerge telling you that the simulation was successful. In this notification, you can either select to (1) see the Raw Data or (2) to proceed with the reconstruction.
[!IMPORTANT]
Starting from KomaMRI v0.9 we are using package extensions to deal with GPU dependencies, meaning that to run simulations on the GPU, installing (add CUDA/AMDGPU/Metal/oneAPI
) and loading (using CUDA/AMDGPU/Metal/oneAPI
) the desired backend will be necessary (see GPU Parallelization and Tested compatibility).
How to Contribute
KomaMRI exists thanks to all our contributors:
Want to be highlighted here? We welcome contributions from the community! If you're interested in contributing, please read "Contribute to Koma" for details on how to get started.
How to Cite
If you use this package, please cite our paper.
Plain Text:
Castillo-Passi, C, Coronado, R, Varela-Mattatall, G, Alberola-LΓ³pez, C, Botnar, R, Irarrazaval, P. KomaMRI.jl: An open-source framework for general MRI simulations with GPU acceleration. Magn Reson Med. 2023; 1- 14. doi: 10.1002/mrm.29635
BibTex:
@article{https://doi.org/10.1002/mrm.29635,
author = {Castillo-Passi, Carlos and Coronado, Ronal and Varela-Mattatall, Gabriel and Alberola-LΓ³pez, Carlos and Botnar, RenΓ© and Irarrazaval, Pablo},
title = {KomaMRI.jl: An open-source framework for general MRI simulations with GPU acceleration},
journal = {Magnetic Resonance in Medicine},
keywords = {Bloch equations, GPU, GUI, Julia, open source, simulation},
doi = {https://doi.org/10.1002/mrm.29635},
url = {https://onlinelibrary.wiley.com/doi/abs/10.1002/mrm.29635},
eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1002/mrm.29635},
}
Tested compatibility
All parallel backends are tested on Linux (besides Apple silicon) using the latest stable release, Julia 1 (stable), and Julia 1.9 (compat).
| KomaMRICore | CPU | GPU (Nvidia) | GPU (AMD) | GPU (Apple) | GPU (Intel) |
|:---------------------|:-----------------------------------:|:-----------------------------------:|:--------------------------------:|:----------------------------------:|:----------------------------------:|
| Julia 1.10 | [![][cpu-compat]][buildkite-url] | [![][nvidia-compat]][buildkite-url] | [![][amd-compat]][buildkite-url] | [![][apple-compat]][buildkite-url] | [![][intel-compat]][buildkite-url] |
| Julia 1 | [![][cpu-stable]][buildkite-url] | [![][nvidia-stable]][buildkite-url] | [![][amd-stable]][buildkite-url] | [![][apple-stable]][buildkite-url] | [![][intel-stable]][buildkite-url] |
Single-threaded compatibility is tested in all major operating systems (OS).
| KomaMRI | CPU (single-threaded) |
|:---------------------|:-----------------------------------------:|
| Julia 1.10 (Windows) | [![][gh-actions-komamri]][gh-actions-url] |
| Julia 1.10 (Linux) | [![][gh-actions-komamri]][gh-actions-url] |
| Julia 1.10 (Mac OS) | [![][gh-actions-komamri]][gh-actions-url] |
| Julia 1 (Windows) | [![][gh-actions-komamri]][gh-actions-url] |
| Julia 1 (Linux) | [![][gh-actions-komamri]][gh-actions-url] |
| Julia 1 (Mac OS) | [![][gh-actions-komamri]][gh-actions-url] |
If you see any problem with this information, please let us know in a GitHub issue.