HyperMRI 🧲
Python research tools for loading, reconstructing, and visualizing MRI data.
Three linked views in Jupyter: an anatomy with the outlines of the other slices. A CSI map of hyperpolarized [1-13C]pyruvate with the fitted spectrum of the selected voxel, and a dynamic map of hyperpolarized [1-13C]pyruvate with its time course. Try the viewer interactively on the documentation home page.
HyperMRI was developed in part in the Schilling Lab at the Technical University of Munich (TUM).
Research-use notice
HyperMRI is research software. It has not been validated or approved as a medical device and is not intended for clinical diagnosis, treatment decisions, or other clinical use. Its outputs may be incomplete, incorrect, or unsuitable for a particular experiment. Users are responsible for independently validating the methods and results and for complying with applicable ethical, privacy, institutional, and regulatory requirements.
Do not publish patient data, identifying metadata, or confidential research data in GitHub issues, discussions, or examples.
Features
- Bruker-first loading and reconstruction: scoped stable support for Bruker ParaVision data, with automatic vendor and sequence detection. Siemens support is Beta; Agilent/Varian, Magritek, and Bruker TopSpin support is Experimental. See the support matrix before relying on a workflow.
- xarray data model: MRI data is
represented as labelled
xarray.DataArrayandxarray.Datasetobjects with metadata and physical coordinates. - Interactive visualization: the Plotly-based viewer supports multidimensional images, spectra, fit curves, and overlays in Jupyter.
- Analysis and export: reusable reconstruction and fitting workflows plus derived DICOM export for supported geometries.
Documentation
The documentation is hosted on Read the Docs:
- hypermri.readthedocs.io/en/stable describes the latest release on PyPI.
- hypermri.readthedocs.io/en/latest
follows the
developbranch.
Installation
pip install hypermri
The steps below start from a computer without Python, conda or Git. HyperMRI needs Python 3.12; conda installs it for you, so you do not need to install Python separately.
1. Install conda
We recommend Miniforge, a free conda installer that uses the community package channel conda-forge. Download the installer for your computer:
| System | Installer |
|---|---|
| Windows | Miniforge3-Windows-x86_64.exe |
| macOS, Apple chip (M1 or newer) | Miniforge3-MacOSX-arm64.sh |
| macOS, Intel chip | Miniforge3-MacOSX-x86_64.sh |
| Linux, x86-64 PC | Miniforge3-Linux-x86_64.sh |
| Linux, ARM | Miniforge3-Linux-aarch64.sh |
On a Mac, the Apple menu > About This Mac shows whether the computer has an Apple chip or an Intel processor.
-
Windows: run the downloaded
.exefile, choose Just Me and keep the default options. -
macOS and Linux: open a terminal and run the downloaded file, for example on a Mac with an Apple chip:
bash ~/Downloads/Miniforge3-MacOSX-arm64.shAccept the licence and answer
yeswhen the installer asks whether to initialize conda. Then close the terminal and open a new one.
If you prefer the graphical Anaconda Navigator to the terminal, install the Anaconda Distribution instead and follow Installation with Anaconda Navigator below. Check the Anaconda terms of service first: organizations with more than 200 employees may need a paid licence.
2. Open a terminal
All commands below are the same on every system. Type them into:
- Windows: Miniforge Prompt from the Start menu,
- macOS: Terminal (press Cmd+Space and type
Terminal), - Linux: the terminal of your desktop, often Ctrl+Alt+T.
The line in the terminal starts with (base) when conda is ready.
3. Create an environment and install HyperMRI
An environment keeps HyperMRI and its dependencies separate from other
Python projects. Create one named hypermri, activate it and install the
package:
conda create -n hypermri python=3.12
conda activate hypermri
pip install hypermri
This installs everything for loading, reconstruction, fitting, the
interactive viewer, Jupyter and Siemens TWIX files. Optional: SimpleITK
motion correction needs pip install "hypermri[motion]".
4. Start Jupyter
jupyter notebook
Jupyter opens in your web browser. In VS Code, select the hypermri
environment as the notebook kernel instead.
Each new terminal starts in the (base) environment. Run
conda activate hypermri again before you start Jupyter or Python.
Alternative: Installation with Anaconda Navigator (Graphical User Interface)
- Open Anaconda Navigator and go to Environments.
- Click Create, enter the name
hypermri, select Python 3.12 and click Create. - Click the ▶ button next to
hypermriand choose Open Terminal. - In this terminal, run
pip install hypermriand thenjupyter notebook.
Next time, open the terminal of the hypermri environment the same way and
run jupyter notebook.
Alternative: Installation with uv
Show the steps for uv, a fast Python package manager
uv downloads Python 3.12 itself, so neither conda nor Python is needed. In a new project folder, create an environment:
uv venv --python 3.12
Activate it on macOS or Linux:
source .venv/bin/activate
or on Windows:
.venv\Scripts\activate
Then install HyperMRI and start Jupyter:
uv pip install hypermri
jupyter notebook
Run the activation command again in every new terminal. In a clone of the
repository, uv pip install -e ".[dev,docs]" installs it for development.
Install from source (developers)
To edit the code or build the documentation, install Git into the environment and clone the repository:
conda activate hypermri
conda install git
git clone https://github.com/LucaNagel/hypermri.git
cd hypermri
pip install -e ".[dev,docs]"
To contribute changes, first fork the repository on GitHub and clone your fork instead; see CONTRIBUTING.md.
The installation guide covers troubleshooting and building the documentation locally.
Usage
from hypermri import Study
# Point Study to a Bruker study folder that you are authorised to use, for
# example the public Lego phantom of the documentation.
study = Study("path/to/20200612_094625_lego_phantom_3_1_2")
# Show the CSI scan on its anatomical image
study[30].plot(anatomy=study[8])
The first look describes where to download the Lego phantom.
The separate optional real-data integration suite uses Tomáš Pšorn's public BrukerAPI ParaVision 6.0.1 Lego-phantom corpus (version 1.1.0, CC BY 4.0); it is not downloaded during installation or normal unit tests.
For stock Bruker CSI, raw-reco removes the first 70
digital-filter/transient samples once per FID and rebuilds the time and
frequency axes for the remaining samples. The original handler FID remains
complete, and scanner-reconstructed 2dseq data is not cut again. See the
support matrix
for the exact reconstruction contract.
The tutorials in the documentation show more examples.
Citation
If you use HyperMRI in your research, please cite it. The Cite this repository button on the GitHub page gives APA and BibTeX entries from CITATION.cff:
@software{hypermri,
author = {Nagel, Luca and {HyperMRI contributors}},
title = {{HyperMRI}: Python research tools for loading, reconstructing,
and visualizing {MRI} data},
url = {https://github.com/LucaNagel/hypermri},
license = {AGPL-3.0-only},
version = {0.1.1}
}
Replace version with the release you used. This command prints it:
python -c "import hypermri; print(hypermri.__version__)"
If you use an example dataset, please also cite the dataset and its article as given in Usage and the documentation.
Contributing
Contributions are welcome. See CONTRIBUTING.md for the review,
testing, data-safety, and licensing rules. Pull requests must pass the required
checks and be approved by the maintainer before they are merged into main.
Historical and current contributors are credited in CONTRIBUTORS.md. Because the public repository starts with a history-free root commit, that file is the canonical public attribution rather than the private development history.
License
HyperMRI is licensed under the
GNU Affero General Public License v3.0 only
(AGPL-3.0-only).
Third-party attribution and modification notices are retained in NOTICE. The adapted BrukerMRI parameter readers retain their Apache License 2.0 text and attribution. Both notices and licence texts are included in the source and wheel packages.
Commercial use is permitted under the license. Its copyleft and source-offer requirements apply when covered modified versions are conveyed and when users interact with a modified version over a network. It does not by itself prohibit a purely private internal fork. The exact license text controls; this summary is not legal advice.
Copyright © HyperMRI contributors.
Metadata
Release files for hypermri 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hypermri-0.1.1.tar.gz | 1.3 MB | With provenance | Details for hypermri-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hypermri-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for hypermri-0.1.1-py3-none-any.whl |
Total release size: 2.8 MB
Release files / hypermri-0.1.1.tar.gz
| Download URL | hypermri-0.1.1.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f64aef052606aa93c01bbff67ae34f366fe8d2a7e4032508d60dd4c7796d7373
|
|
BLAKE2b-256 checksum How to use checksums |
86be2d6486d3516ce562b7d3e10af209a510a901f6e8da1c3dd61f839b0ae0c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 30, 2026.
Transparency logRelease files / hypermri-0.1.1-py3-none-any.whl
| Download URL | hypermri-0.1.1-py3-none-any.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74109acb85dcb2f6d7f90450b551a8eb56c9efd79c6955923f0c8ba8bd9cafc8
|
|
BLAKE2b-256 checksum How to use checksums |
514504858b2944906c24360a2461d6c6570e1c0a7491105d81d02c08643e4659
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 30, 2026.
Transparency logSecurity for hypermri 0.1.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.
Attestation for hypermri-0.1.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 Nov 30, 2026.
Transparency logA 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.