Skip to main content

SpinePrep — reproducible, QC-first preprocessing for spinal-cord fMRI

CI Release License Python Documentation NeuroStars

Reproducible, QC-first preprocessing for human spinal-cord fMRI.
An open, containerised BIDS-App — a BIDS dataset in, GLM-ready derivatives and per-step quality control out.


SpinePrep automates the field's recommended cord-fMRI recipe end to end, with one step-local truth metric and one visual reportlet at every step. It follows the design of the established brain pipelines (fMRIPrep, MRIQC, SCT) and applies it to a 5–7 mm structure that moves, distorts, and spans vertebral levels.

The scientific methods belong to the tools SpinePrep integrates — the Spinal Cord Toolbox, FSL, ANTs, and the PAM50 template. SpinePrep's contribution is the integration, automation, reproducibility, and standardised quality control around them, not new algorithms.

Pipeline

flowchart TB
  IN([BIDS dataset]) --> P
  subgraph P ["Set up"]
    direction LR
    S1[S1 Input verify] --> S2[S2 Anat cordref] --> S3[S3 Func ref + crop]
  end
  P --> C
  subgraph C ["Align & correct"]
    direction LR
    S4[S4 Motion] --> S5[S5 Distortion] --> S6[S6 Func to anat]
  end
  C --> N
  subgraph N ["Normalize & derive"]
    direction LR
    S7[S7 PAM50 normalize] --> S8[S8 Confounds] --> S9[S9 Derivatives]
  end
  N --> S10["S10 QC & release"] --> OUT([GLM-ready derivatives + QC report])

Each step measures itself in isolation (its own pass/warn/fail metric) and emits a diagnostic reportlet, so a failure is attributable to the step that caused it.

Quality control is the validator

Every run produces self-contained HTML reports — the human eyeballs the figures; the numbers quantify the call. One reportlet should tell you what failed and why.

Temporal SNR before and after preprocessing (S4 reportlet)

Installation

SpinePrep ships as a build recipe, not a prebuilt image — a deliberate choice. The container installs FSL, which is free for academic/non-commercial use but carries non-commercial licence terms. Building the image yourself (rather than us redistributing one that bundles FSL) keeps SpinePrep's own Apache-2.0 distribution unencumbered, and you obtain FSL directly under its own licence.

git clone https://github.com/SpinePrep/SpinePrep.git
cd SpinePrep
docker build -f Dockerfile.spineprep \
  --build-arg GIT_SHA=$(git rev-parse HEAD) \
  --build-arg GIT_DESCRIBE=$(git describe --always --tags) \
  -t spineprep:26.0.0 .

For HPC, convert the image to Apptainer — see the quickstart.

Local (advanced)

The Python orchestration layer installs with pip, but the full pipeline also needs SCT, FSL, and ANTs on your PATH (the container provides these). A PyPI release is planned; for now, install from a clone:

git clone https://github.com/SpinePrep/SpinePrep.git
cd SpinePrep && pip install .

Quickstart

SpinePrep uses the standard BIDS-App interface:

# participant level: preprocess each subject
docker run --rm -v /path/to/bids:/bids:ro -v /path/to/out:/out \
  spineprep:26.0.0 /bids /out participant --participant-label sub-01

# group level: aggregate QC and write the release report
docker run --rm -v /path/to/bids:/bids:ro -v /path/to/out:/out \
  spineprep:26.0.0 /bids /out group

See the documentation for options, configuration, and the full walkthrough.

What you get

  • BIDS-native — a BIDS dataset in, BIDS-Derivatives out; no manual masking.
  • Cord-focused — segmentation, motion, distortion and PAM50 normalization tuned for the cord, not adapted from brain defaults.
  • Readable QC — one truth metric and one reportlet per step, plus subject- and group-level HTML reports with a reconciled attrition waterfall.
  • Reproducible — deterministic runs, versioned policy, and a provenance receipt (tool + policy + git SHAs); a re-run reproduces the same numbers under the same tool versions.

Documentation

Full documentation lives at spineprep.com:

Citation

If you use SpinePrep, please cite the software and the tools it builds on (SCT, FSL, ANTs, PAM50) — the auto-generated methods boilerplate in each report lists them, and How to cite gives the references.

@software{spineprep,
  title   = {SpinePrep: a containerised BIDS-App for reproducible
             spinal-cord fMRI preprocessing},
  author  = {Sharifi, Kiomars},
  year    = {2026},
  version = {26.0.0},
  url     = {https://spineprep.com}
}

GitHub's "Cite this repository" button reads CITATION.cff and always gives the current form.

Contributing

Contributions are welcome — see CONTRIBUTING.md and the Code of Conduct. For usage questions, please post on the NeuroStars spineprep tag rather than the issue tracker, so answers stay searchable for the next person.

Acknowledgements

SpinePrep builds directly on the Spinal Cord Toolbox, FSL, ANTs, and the PAM50 template, and follows the design philosophy of fMRIPrep. We are grateful to those projects and their communities.

License

Apache-2.0 — see LICENSE. SpinePrep integrates third-party tools under their own licences; see NOTICE.

Metadata

Release files for spineprep 26.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spineprep 26.0.0
File Size Uploaded
spineprep-26.0.0.tar.gz 333.5 kB Details

Built distribution (wheel)

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

Total release size: 718.5 kB

Release files / spineprep-26.0.0.tar.gz

Download URL spineprep-26.0.0.tar.gz
Size 333.5 kB
Tags Source
SHA-256 checksum
How to use checksums
04fecd0d6778637ca84d60006304d7164b78ec771b403604863c7b8b7900ea88
BLAKE2b-256 checksum
How to use checksums
59f5f6c3aab7c3fdbab8fff4c105c7c44dbb346add732d8c1e7938b88b2f4ba8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 10, 2026.

Transparency log

Release files / spineprep-26.0.0-py3-none-any.whl

Download URL spineprep-26.0.0-py3-none-any.whl
Size 385.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd29b93027b05ef03b892c6a42afe0cfd50c9f3428310bbb17d9ab221592a9e2
BLAKE2b-256 checksum
How to use checksums
9d5d455a8a894f7941a4933342f6b512d4200f7e5fa774d9fa9ef3bcbd72bf0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

26.0.0 This release

2 release files

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