API Reference
MRSIPrep is structured as a library of workflow-orchestration functions, one
per pipeline stage, invoked in sequence by
mrsiprep.workflows.participant.run_participant_workflow() -- the
same top-level entry point the CLI calls. Each stage function takes the
run's config object plus the outputs of earlier stages and returns a
small dataclass result that later stages consume.
This page documents the internal architecture for anyone extending
MRSIPrep or calling its stages directly from Python (import mrsiprep)
rather than through the CLI. For end-user usage and the full CLI flag
reference, see Basic Usage.
Configuration
Runtime configuration objects. |
|
Default values for MRSIPrep. |
Top-level orchestration
Participant workflow orchestration. |
|
Workflow base helpers. |
Pipeline stage workflows
Each module below wraps one pipeline stage (see the Workflow Architecture
section on the home page for the stage order) behind a single
run_*_workflow entry point.
Anatomical preparation workflow. |
|
MRSI preprocessing workflow. |
|
Tissue workflow. |
|
Registration workflow. |
|
Parcellation workflow. |
|
Metabolic profile and connectivity workflow. |
|
Report workflow. |
Registration
MRSI-to-T1 registration. |
|
T1-to-MNI registration. |
|
Subject-level longitudinal template construction and template-to-MNI registration. |
|
Transform path and application helpers. |
Backend interfaces
Thin wrappers around the external registration/segmentation tools MRSIPrep shells out to or calls via Python bindings.
ANTs/antspyx interface. |
|
FSL FLIRT/FNIRT registration interface. |
|
FreeSurfer helpers. |
|
Chimera parcellation wrapper. |
MRSI processing
Biharmonic-style MRSI spike filtering. |
|
MRSI mask helpers. |
|
Voxelwise MRSI QC masks. |
|
MRSI reference image generation. |
|
MRSI resampling helpers. |
|
Partial-volume correction via PETPVC. |
Tissue segmentation
SynthSeg-constrained FSL FAST tissue backend. |
|
MIDAS-style fuzzy c-means tissue segmentation. |
|
Tissue fraction map helpers. |
|
MIDAS-style PSF-based tissue-fraction convolution. |
Parcellation and connectivity
Lightweight SynthSeg cortical and subcortical parcellation. |
|
Chimera native-space parcellation workflow. |
|
MNI atlas parcellation workflow. |
|
Regional metabolite extraction. |
|
MIDAS-style (Maudsley et al. 2006, Eq. |
|
Connectivity export helpers. |
|
Perturbation-based metabolite connectivity. |
I/O
Input layout discovery for MRSIPrep. |
|
MRSI input loading helpers. |
|
BIDS-like naming helpers. |
|
Derivative directory helpers. |
|
Input validation. |
|
MRSinMRS (Lin et al. 2021, PMID 33559967) sequence-parameter reporting. |