MRSIPrep: A Robust Preprocessing Pipeline for Whole-Brain MRSI Data
About
MRSIPrep is a magnetic resonance spectroscopic imaging (MRSI) data preprocessing pipeline that is designed to provide an easily accessible, robust interface requiring minimal user input, while providing easily interpretable and comprehensive quality-control reporting. It performs basic processing steps (registration to anatomical and template space, tissue segmentation, partial-volume correction, atlas projection, etc.) on already quantified whole-brain MRSI maps, providing outputs that can be easily submitted to a variety of group-level analyses, including voxel-based analysis, regional statistics, and metabolic connectivity.
Full documentation, installation, and usage instructions are on Read the Docs.
Design Principles
MRSIPrep was designed according to four main principles:
- Reproducibility — distributed as open-source software, executed in containerized environments to minimize differences across computing platforms.
- Modularity — each processing stage is an independent module, so users can enable, disable, or replace specific steps according to their acquisition protocol and scientific question.
- Transparency — automated quality-control reports summarize spatial
registration, metabolite coverage, voxel-level quality metrics, tissue
composition, and atlas projection, including the acquisition's
MRSinMRS sequence parameters
(required at
derivatives/mrsi-orig/mrsinmrs.jsonor selected with--mrsinmrs-file) and a citation section. Published-study parameter sets can be reproduced with--config-preset <name>(see--list-presets), which also credits the source publication in the report. - Analysis agnosticism — MRSIPrep does not impose a specific downstream analysis; it generates standardized derivatives usable for voxelwise analyses, regional analyses, metabolic connectomics, gradient mapping, or machine-learning workflows.
See Read the Docs for the full workflow architecture and quality-control framework.
Repository Structure
The mrsiprep/ package is organized by processing stage, matching the
pipeline's modular design:
mrsiprep/
├── cli/ Command-line entry point and argument parsing
├── config/ Default parameters, literature T1/T2 values, nucleus and template definitions
├── connectivity/ Metabolic connectivity matrix construction and export
├── interfaces/ Wrappers around external tools (ANTs, FSL, Chimera/FreeSurfer, BIDS import)
├── io/ BIDS discovery, MRSinMRS parsing, derivative I/O, input validation
├── mrsi/ MRSI-specific operations: masking, resampling, spike filtering, T1 correction, orientation
├── parcellation/ Atlas registration, SynthSeg/Chimera parcellation, region labeling
├── qc/ Quality-control metrics (e.g. ventricle detection)
├── registration/ MRSI-to-T1w and T1w-to-template registration backends and transforms
├── reports/ HTML QC report generation
├── tissue/ Tissue segmentation and partial-volume fraction computation
├── utils/ Shared helpers: logging, provenance tracking, image utilities
└── workflows/ Nipype workflow graphs tying the stages above into the full pipeline
Other top-level directories: docs/ (Read the Docs source), docker/ (image
build scripts, see docker/README.md), wrapper/ (the mrsiprep-docker
PyPI package, a dependency-free Python wrapper that runs the Docker image
using normal BIDS App syntax), tests/ (unit and integration tests),
experiments/ (benchmark and validation scripts used to produce the
manuscript's results, not part of the installed package), and examples/
(runnable usage examples referenced from the docs).
Test Dataset
A small, public, synthetic MRSI dataset — SynthMRSI-Project — is available for anyone to download and run through MRSIPrep themselves, without needing access to real MRSI acquisitions. It pairs real T1w anatomical images (subsetted from two CC0 OpenNeuro datasets) with model-synthesized MRSI signal and empirical CRLB/SNR/FWHM quality maps, following MRSIPrep's own raw-MRSI-input convention.
- Published on Zenodo: 10.5281/zenodo.21477047 (CC0)
- Full download and usage instructions: PUBLIC_DATASET.md
- Used as the fixture for this repo's automated end-to-end pipeline test (see the "e2e full pipeline" badge above)
SynthMRSI-Project is never modified after publication — its Zenodo
record is fixed and citable. A separate, unpublished internal dataset,
SynthMRSI-VBA-Project, is used instead for voxel-based-analysis
validation work (region-based abnormality injection, ANTs-vs-FSL
registration-backend comparison via randomise). It shares the same T1w
subjects as SynthMRSI-Project but is generated independently with
--inject-abnormal, so it can carry deliberately-injected ground-truth
abnormalities without touching the published, immutable dataset. See
synthMRSI/SYNTHMRSI_PROJECT.md for the
full generation and validation commands.
Use Cases
Code derived from this pipeline has been used in the following peer-reviewed publications:
- Lucchetti, F., et al. (2025). Constructing the human brain metabolic connectome with MR spectroscopic imaging reveals cerebral biochemical organization. Nature Communications, 16. doi:10.1038/s41467-025-66124-w
- Céléreau, E., et al. (2026). High-resolution whole-brain magnetic resonance spectroscopic imaging in youth at risk for psychosis. Imaging Neuroscience, 4. doi:10.1162/imag.a.1276
- Céléreau, E., et al. (2026). Sex differences in brain metabolism assessed with whole-brain magnetic resonance spectroscopic imaging. bioRxiv, 2026-06. doi:10.64898/2026.06.30.735476
How to Cite
If you use MRSIPrep in your research, please cite:
Lucchetti, F., Céléreau, E., Jenni, R., Ledoux, J.-B., Eliez, S., Delavari, F., Hagmann, P., Alemán-Gómez, Y., Klauser, A., & Klauser, P. (2026). MRSIPrep: A Standardized Post-Quantification Framework for Preprocessing Whole-Brain Magnetic Resonance Spectroscopic Imaging. bioRxiv. doi:10.64898/2026.09.11.750896
@article{lucchetti2026mrsiprep,
title={MRSIPrep: A Standardized Post-Quantification Framework for Preprocessing Whole-Brain Magnetic Resonance Spectroscopic Imaging},
author={Lucchetti, Federico and Celereau, Edgar and Jenni, Raoul and Ledoux, Jean-Baptiste and Eliez, Stephan and Delavari, Farnaz and Hagmann, Patric and Aleman-Gomez, Yasser and Klauser, Antoine and Klauser, Paul},
journal={bioRxiv},
pages={2026--09},
year={2026},
publisher={Cold Spring Harbor Laboratory}
}
License
MRSIPrep is distributed under the CHUV academic non-commercial research license; see LICENSE for the full text.
Attribution
Substantial implementation logic is cropped and refactored by Federico Lucchetti and Edgar Céléreau. The original
license is included in LICENSE.
Acknowledgments
MRSIPrep builds on the work of the ANTs, FreeSurfer, FSL, PETPVC, Chimera, and TemplateFlow projects.
Metadata
Release files for mrsiprep 2.2.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 |
|---|---|---|---|---|
| mrsiprep-2.2.1.tar.gz | 7.4 MB | Without provenance | Details for mrsiprep-2.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mrsiprep-2.2.1-py3-none-any.whl | Python 3 | none | any | Details for mrsiprep-2.2.1-py3-none-any.whl |
Total release size: 14.6 MB
Release files / mrsiprep-2.2.1.tar.gz
| Download URL | mrsiprep-2.2.1.tar.gz |
|---|---|
| Size | 7.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c812f6095edf3dbf3eeaa5388f74f5c299d9ea96d7c299f69d482bae43ed617
|
|
BLAKE2b-256 checksum How to use checksums |
e57602d7490f1f8d24c42ab77f24286a4014699f6d76c9321dfd82cbf1285f9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / mrsiprep-2.2.1-py3-none-any.whl
| Download URL | mrsiprep-2.2.1-py3-none-any.whl |
|---|---|
| Size | 7.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f33ba856965c4e2778bbf63a6e3347bd4d551c669ccc9bd2428acbe111f7967c
|
|
BLAKE2b-256 checksum How to use checksums |
15026434f428f1039a6da66d0672af871fc1f690f2fa73d8e1fe967d8e0e7497
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for mrsiprep 2.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.