JAX-based tools for quantitative MRI model fitting, reconstruction, and analysis.
Project description
MRax
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.6 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])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mrax-0.1.0.tar.gz.
File metadata
- Download URL: mrax-0.1.0.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15851a7688f89ce6ccc9a090e34b5a180442ec17b4ade94d3a9a2e0baa287dc8
|
|
| MD5 |
5b39bfa31fecc2d31e15b14ff8a2c08b
|
|
| BLAKE2b-256 |
c4e617b043dabc6c0b9eae493969c0dfff88e8876e683600a96ab563a98c419f
|
Provenance
The following attestation bundles were made for mrax-0.1.0.tar.gz:
Publisher:
publish.yml on chris-lippe/MRax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrax-0.1.0.tar.gz -
Subject digest:
15851a7688f89ce6ccc9a090e34b5a180442ec17b4ade94d3a9a2e0baa287dc8 - Sigstore transparency entry: 2137850417
- Sigstore integration time:
-
Permalink:
chris-lippe/MRax@5bea7703576047f175de1989f268934a04e69e3c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/chris-lippe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5bea7703576047f175de1989f268934a04e69e3c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mrax-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mrax-0.1.0-py3-none-any.whl
- Upload date:
- Size: 384.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a88f41f07b4c956cff672dfc8b8a3f3cdbd247fde536e93a0a41f90962320b6
|
|
| MD5 |
b5ecd66f21db495429bbb083a59f651b
|
|
| BLAKE2b-256 |
8f96f18e3f146bb499d2d42858ae420235d73076983fb002f433222912560a4d
|
Provenance
The following attestation bundles were made for mrax-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on chris-lippe/MRax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrax-0.1.0-py3-none-any.whl -
Subject digest:
5a88f41f07b4c956cff672dfc8b8a3f3cdbd247fde536e93a0a41f90962320b6 - Sigstore transparency entry: 2137850455
- Sigstore integration time:
-
Permalink:
chris-lippe/MRax@5bea7703576047f175de1989f268934a04e69e3c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/chris-lippe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5bea7703576047f175de1989f268934a04e69e3c -
Trigger Event:
workflow_dispatch
-
Statement type: