Skip to main content

MRax logo

MRax

DOI Visit the Docs

MRax is a JAX-based Python library for quantitative MRI research. It provides data structures for experiments and studies, differentiable signal models, optimization utilities, reconstruction helpers, analysis tools, and portable .mrax study bundles for images, k-space, and fitted maps.

MRax is intended for research use only. Coding agents assisted development.

Installation

Install the release package from PyPI:

pip install mrax

The default install includes fitting, Cartesian and non-Cartesian reconstruction, import, built-in denoising, registration, analysis, storage, and desktop GUI support. External denoising backends are installed explicitly:

pip install "mrax[denoise-external]"

The upstream bm3d and bm4d packages are licensed for non-commercial use; review their licenses before installing the denoise-external extra. Development, documentation, and notebook authoring tools remain outside the base runtime package.

MRax uses the mrax.* import namespace:

from mrax.core.loss_builder import run_fit
from mrax.library import make_t2_se_model

Contributor extras are available for notebook and documentation workflows:

pip install "mrax[notebooks]"
pip install "mrax[docs]"

For local development from a clone:

python -m pip install --upgrade pip
python -m pip install -e ".[all,dev,docs,notebooks]"
pytest

Dev Container

The repository includes two VS Code compatible dev container configurations that share docker/Dockerfile.dev:

Configuration File GPU support
MRax development (CPU), default .devcontainer/devcontainer.json No GPU required; standard JAX installation
MRax development (NVIDIA GPU), opt-in .devcontainer/gpu/devcontainer.json NVIDIA GPU passthrough and CUDA 12-enabled JAX

Open the public clone in VS Code and choose Dev Containers: Reopen in Container. Select MRax development (CPU) for the default setup, which works on machines without a GPU. Both configurations install all runtime features plus development, documentation, and notebook tooling, then install MRax in editable mode. The CPU configuration uses:

python -m pip install -e ".[all,dev,docs,notebooks]"

For NVIDIA GPU development, select MRax development (NVIDIA GPU) instead. From an open dev container, use Dev Containers: Switch Container to change the configuration. The GPU option also installs jax[cuda12]>=0.4.35,<0.11 and requires an NVIDIA GPU and compatible driver on the Docker host. On Linux, install and configure the NVIDIA Container Toolkit for Docker. On Windows, follow Docker Desktop's WSL 2 GPU setup.

After changing a configuration, run Dev Containers: Rebuild Container to apply the startup options and dependency installation. Inside the GPU container, verify that JAX lists a CUDA device:

python -c "import jax; print(jax.devices())"

Inside the container, common checks are:

pytest
sphinx-build -E -b html docs docs/_build/html
jupyter lab notebooks

Documentation Website

Documentation is built with Sphinx:

python -m pip install -e ".[docs]"
sphinx-build -E -b html docs docs/_build/html

Visit the GitHub-hosted documentation at https://chris-lippe.github.io/MRax/.

PyPI Release

Build and inspect a local distribution with:

python -m pip install -e ".[all,dev,docs,notebooks]"
python -m build
twine check dist/*

Quick Example

import jax.numpy as jnp

from mrax.core.loss_builder import run_fit
from mrax.data_struct import DataSet, Quantity
from mrax.library import build_default_experiment, make_t2_se_model

te = jnp.asarray([8.0, 24.0, 48.0, 96.0])
experiment = build_default_experiment(
    "mse",
    frame_count=te.size,
    spatial_shape=(2, 2),
    observables={"TE": Quantity(te, "ms")},
)
model = make_t2_se_model(scale=1.0)
dataset = DataSet(data=jnp.ones((te.size, 2, 2)), name="demo")

fields, losses = run_fit(experiment, model, dataset, num_steps=20, step_size=0.03)
print(fields["t2"].si_unit, losses[-1])

How to cite

If you use MRax in your research, please cite the specific release you used. Open MRax on Zenodo, select your release under Versions, and copy its citation or BibTeX, including the release DOI.

For a general reference to the project, use:

Lippe, C. MRax: JAX-based tools for quantitative MRI research [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.21723327

Metadata

Release files for mrax 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mrax 0.3.0
File Size Uploaded Provenance Actions
mrax-0.3.0.tar.gz 2.0 MB With provenance Details for mrax-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mrax 0.3.0
File Interpreter ABI Platform Actions
mrax-0.3.0-py3-none-any.whl Python 3 none any Details for mrax-0.3.0-py3-none-any.whl

Total release size: 2.5 MB

Release files / mrax-0.3.0.tar.gz

Download URL mrax-0.3.0.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
8779ccde7550c2576aa93088c4088c2e17680a77f1309c436a4be8630c6f6a97
BLAKE2b-256 checksum
How to use checksums
74dd50f39b414c6cfc96c449518237d2030ef31ab5b374342e8d1e3085a894c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / mrax-0.3.0-py3-none-any.whl

Download URL mrax-0.3.0-py3-none-any.whl
Size 529.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c664d42313b8cf636a835428cb9ae3658b3a68d667bde38ce35c99221f57376f
BLAKE2b-256 checksum
How to use checksums
0945fc1bb055910cc2aef25df88c1ca5f77c387090e370980d2a9a457f257ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Security for mrax 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mrax-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page