Skip to content

MRsources/MRzero-Core

Repository files navigation

Documentation Status PyPI - Version

MRzero Core

The MRzero Core contains the core functionality of MRzero like MRI sequence building, simulation and reconstruction. MRzero Core does not force you to take any particular approach to e.g., reconstruction, as it targets easy integration in existing projects. Nevertheless, more tools can be added in the future if they helpful for the general application space.

Usage

MRzero Core is written in Python, heavily relying on PyTorch for fast (GPU-) Tensor calculations. To improve performance, parts of the simulation are written in Rust and compiled for x86 Windows and Linux, other platforms are currently not supported.

Install with pip:

pip install MRzeroCore 

The typical way of using it is like the following:

import MRzeroCore as mr0

Examples on how to use MR-zero can be found in the Playground.

Pulseq Integration

MRzero Core makes Pulseq simulation incredibly easy - simulate any .seq file in just one line:

import MRzeroCore as mr0 # Simulate any Pulseq file seq = mr0.Sequence.import_file("your_sequence.seq") signal = mr0.util.simulate(seq) # That's it!

Key Features:

  • One-line simulation of any Pulseq .seq file
  • PyPulseq integration - write sequences in Python, simulate with MR-zero
  • Google Colab ready - 13+ ready-to-run examples
  • MATLAB ↔ Python workflow - create in MATLAB Pulseq, simulate in Python
  • No dependencies - fully self-contained Pulseq parser included
  • Scanner-ready export - export MR-zero sequences as .seq files

Try it now: Open In Colab

Links

Building from source

This assumes windows as host operating system. For building the python wheel, you need:

Building for Windows

maturin build --interpreter python 

Building for Linux

docker run --rm -v <path-to-repo>/MRzero-Core:/io ghcr.io/pyo3/maturin build 

Building the documentation

Install newest (beta) version of mdBook:

cargo install --git https://github.com/rust-lang/mdBook.git mdbook

Run a live-preview server:

# in the root directory: mdbook serve documentation

Official builds

The python wheels hosted by PyPI is built as described above, and uploaded as following:

maturin upload target/wheels/MRzeroCore-{ version }-cp37-abi3-win_amd64.whl target/wheels/MRzeroCore-{ version }-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -u <pypi-user> -p <pypi-pwd> 

The documentation is built using readthedocs, which works the same as described above.

About

Python package and documentation for MR-zero

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 10