Skip to main content

MRax logo

MRax

DOI

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 ISMRMRD-backed storage for images, k-space, and fitted maps.

Disclaimer: MRax is intended for research use only. This is an early release, and bugs may occur. Coding agents were used to assist in development. Code was manually reviewed and validated on Bruker ParaVision 360 3.5–3.7 data.

Installation

Install the release package from PyPI:

pip install mrax

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

pip install "mrax[nufft]"
pip install "mrax[denoise-external]"

jax-finufft does not publish Windows wheels. 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 one VS Code compatible dev container. Open the public clone in VS Code and choose Dev Containers: Reopen in Container. The container installs all runtime features plus development, documentation, and notebook tooling, then installs MRax in editable mode:

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

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

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])

Metadata

Release files for mrax 0.2.1

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.2.1
File Size Uploaded Provenance Actions
mrax-0.2.1.tar.gz 1.9 MB With provenance Details for mrax-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 2.3 MB

Release files / mrax-0.2.1.tar.gz

Download URL mrax-0.2.1.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
d64637ddd24544ac77f5bcd614ae61692fe6fe877d69a0877ff0819a30ea0f6d
BLAKE2b-256 checksum
How to use checksums
7560f7304b6d76cd84c408722e841d1db50cd76fe7606625923423705db40e2c
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 Aug 10, 2026.

Transparency log

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

Download URL mrax-0.2.1-py3-none-any.whl
Size 428.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4696cbe08975cd125bf315628cedf479b1de1bebc4fb7d930a32c93bf942a67d
BLAKE2b-256 checksum
How to use checksums
de78d0c9e99a3a2003e5881643a5ae811aa97a6537eb25385657c48c112f0b0d
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 Aug 10, 2026.

Transparency log

Security for mrax 0.2.1

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.2.1.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 Aug 10, 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