Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical & Research SuppliesReagents, PPE & instruments — chain-of-custody documented.Fast, traceable sourcing built for regulated research environments, from bench consumables to instrumentation.Shop lac.us CodeCASRAIlac.us

fMRIPrep: Neuroimaging Preprocessing Guide

Learn how fMRIPrep standardizes fMRI data preprocessing using BIDS, containerized workflows, and automated quality reporting for reproducible neuroscience.

Written and maintained by CASRAI Editorial Board

Last updated

fMRIPrep is an automated, robust functional magnetic resonance imaging (fMRI) preprocessing pipeline maintained by the NiPreps Community. Built on the Nipype workflow engine, it integrates algorithms from leading neuroimaging toolkits to convert raw structural and functional MRI scans into standardized, minimally preprocessed derivatives. In contemporary neuroscience research, fMRIPrep establishes reproducible pipelines that eliminate manual idiosyncrasies across heterogeneous scanning environments.

What it is

fMRIPrep is a standardized BIDS App designed to solve preprocessing variability in neuroimaging research. Packages such as FSL, SPM, and AFNI apply divergent mathematical operations for spatial normalization, tissue segmentation, and motion correction. fMRIPrep provides an automated, adaptive pipeline that harmonizes these operations according to three foundational principles:

  • Robustness: The pipeline dynamically adapts its workflow based on scan parameters, field strengths, and the presence or absence of distortion-correction scans (such as phase-difference or opposite phase-encoding fieldmaps).
  • Ease of use: By adhering strictly to the Brain Imaging Data Structure (BIDS) standard, the workflow eliminates manual parameter entry and automatically parses participant metadata.
  • “Glass box” philosophy: Automation does not obscure data handling. fMRIPrep produces comprehensive, interactive visual HTML reports for every subject, allowing researchers to inspect skull-stripping boundaries, tissue segmentation contours, and functional-to-anatomical coregistrations.

fMRIPrep performs minimal preprocessing: head-motion correction, susceptibility distortion unwarping, non-linear spatial normalization, bias field correction, and brain tissue segmentation. It intentionally avoids spatial smoothing and high-pass temporal filtering to prevent introducing irreversible biases into downstream statistical models, such as first-level general linear models (GLMs), resting-state connectivity, or multi-voxel pattern analysis (MVPA).

Who runs it and what it covers

fMRIPrep is steered and maintained as an open-source initiative by the NiPreps Community. The pipeline was originally developed by the Center for Reproducible Neuroscience (CRN) and the Poldrack Lab at Stanford University, with foundational methodology published by Esteban et al. (2019) in Nature Methods (doi:10.1038/s41592-018-0235-4).

Development and community maintenance of fMRIPrep have been supported by federal and philanthropic grants, including:

  • National Institute of Biomedical Imaging and Bioengineering (NIH NIBIB grant R01EB020740, PI: Ghosh).
  • National Institute of Mental Health (NIMH grants R24MH114705, R24MH117179, and R01MH121867, PI: Poldrack).
  • The Laura and John Arnold Foundation.

fMRIPrep covers structural and functional MRI modalities by orchestrating specialized tools within a container: Advanced Normalization Tools (ANTs) for symmetric diffeomorphic spatial registration and N4 bias correction, FMRIB Software Library (FSL) for brain extraction and functional motion correction, FreeSurfer for cortical surface reconstruction, and AFNI for susceptibility distortion correction. This transparent operational architecture assists investigators in fulfilling the data traceability and workflow reproducibility benchmarks required under the NIH rigor and reproducibility policy.

How to search or use it

fMRIPrep operates as a command-line containerized tool adhering to the BIDS-Apps execution standard. Researchers follow six operational steps to prepare, execute, and verify preprocessed datasets:

  1. Format and validate dataset into BIDS: Organize raw DICOM images converted to NIfTI (.nii.gz) files and JSON sidecars into the BIDS directory structure (e.g., sub-01/anat/ and sub-01/func/). Verify metadata compliance using the official BIDS Validator.
  2. Acquire FreeSurfer license file: Because cortical surface reconstruction uses FreeSurfer, obtain a free license key (license.txt) from the FreeSurfer registration portal and store it in an accessible path.
  3. Select container deployment runtime: In high-performance computing (HPC) environments, deploy fMRIPrep via Apptainer or Singularity containers to ensure execution isolation without root privileges; on workstations, deploy via Docker using the fmriprep-docker wrapper (see Docker vs virtual machines).
  4. Execute the participant-level pipeline: Run the container command specifying the BIDS root directory, the derivatives output directory, and the participant level. For example:
    fmriprep /data/bids_root /data/derivatives participant 
      --participant-label 01 
      --fs-license-file /opt/freesurfer/license.txt 
      --output-spaces MNI152NLin2009cAsym fsnative 
      -w /scratch/work_dir 
      --nprocs 8 --mem-mb 32000
  5. Inspect individual visual quality reports: Open the generated sub-01.html file in a web browser. Examine animated alignment overlays between the functional BOLD image and anatomical T1w reference, verify FreeSurfer surface boundary placements, and review carpet plots showing BOLD intensity fluctuations alongside framewise displacement (FD) and DVARS curves.
  6. Export derivatives into downstream analytical pipelines: Integrate the preprocessed volumes (*_desc-preproc_bold.nii.gz) and extracted confound regressors (*_desc-confounds_timeseries.tsv) into second-stage statistical modeling, aligning institutional storage with data sharing and DMP protocols.

Strengths and limits

  • Strengths:
    • Standardization: Enforces uniform processing logic across multi-site datasets, eliminating operator discrepancies.
    • Quality assurance transparency: Visual HTML reports provide unambiguous audit trails of registration accuracy and motion artifacts.
    • BIDS-Derivatives interoperability: Standardized output naming simplifies integration with downstream statistical libraries such as Nilearn and FitLins.
    • Surface and volume versatility: Simultaneously generates volumetric MNI-space outputs and FreeSurfer cortical surface meshes.
  • Limits:
    • High computational overhead: Full surface reconstruction using FreeSurfer recon-all can require 8 to 24 hours of CPU time per subject unless explicitly bypassed with the --fs-no-reconall flag.
    • Storage demands: Intermediate working directories created by the -w flag require tens of gigabytes of high-throughput scratch storage per subject during execution.
    • Strict input validation: Datasets containing non-compliant BIDS metadata will fail execution unless corrected or overridden with --skip-bids-validation.

Alternatives

Researchers evaluate several alternative software environments based on project scope, software familiarity, and institutional compute infrastructure.

Platform / Pipeline Primary Architecture Input Data Standard Container Support Surface Reconstruction Visual QA Automation
fMRIPrep Python / Nipype / Multi-tool BIDS mandatory Native Docker & Apptainer Integrated (FreeSurfer) Automated interactive HTML
SPM (Statistical Parametric Mapping) MATLAB / Compiled C Any NIfTI format Community Docker images Requires external add-ons Manual slice display & plots
FSL FEAT C++ / Tcl / GUI NIfTI / BIDS optional Available via Neurodocker Volumetric focus (CIFTIFY separate) Static HTML summary pages
AFNI (afni_proc.py) C / Python scripting BRIK/HEAD or NIfTI Containerized builds available Interfaced via SUMA Automated static QC HTML pages
HCP Pipelines Bash / Python / Connectome Workbench BIDS-like raw structure Containerized builds available Native surface mesh focus Automated QC scene files

FAQ

How does fMRIPrep differ from a standard manual tutorial pipeline?

Traditional manual preprocessing tutorials involve running sequential scripts across separate software tools (such as manual realignment in SPM, brain extraction in FSL, and normalization in ANTs). This introduces user-dependent discrepancies and error-prone file handling. fMRIPrep automates these steps through a containerized workflow that queries scan parameters directly from BIDS metadata sidecars, ensuring identical processing decisions across all participants.

What outputs are generated in the BIDS derivatives directory?

fMRIPrep generates preprocessed anatomical images (including brain masks, tissue segmentations, and spatial transforms), preprocessed functional time series resampled into requested output spaces (e.g., MNI152NLin2009cAsym or fsaverage), comprehensive confound tables containing motion parameters, framewise displacement, and anatomical CompCor components, and standalone visual HTML quality assurance reports for each participant.

Why does fMRIPrep omit spatial smoothing?

fMRIPrep intentionally omits spatial smoothing because the appropriate smoothing kernel varies fundamentally depending on study objectives. Task-based activation analyses may benefit from 6 mm full-width at half-maximum (FWHM) smoothing, whereas multi-voxel pattern analysis (MVPA) and high-resolution laminar fMRI require unsmoothed data. Leaving data unsmoothed preserves analytical flexibility without forcing re-execution of core registration workflows.

How do researchers configure scratch space to avoid HPC memory crashes?

In high-performance computing clusters, users must assign high-speed scratch storage to the working directory using the -w flag (e.g., -w /scratch/$USER/fmriprep_work). Intermediate files should never be written to shared home directories or network filesystems with tight quota or inode restrictions. Allocating at least 16 GB to 32 GB of memory per subject using --mem-mb prevents out-of-memory kernel termination during ANTs registration.

Sources

  • NiPreps Community. (2026). fMRIPrep: A Robust Preprocessing Pipeline for fMRI Data. Documentation hosted at https://fmriprep.org/en/stable/ (read 2026-11-08).
  • NiPreps Community. (2026). fMRIPrep Usage Notes and Command-Line Interface. Documentation hosted at https://fmriprep.org/en/stable/usage.html (read 2026-11-08).
  • Esteban, O., Markiewicz, C. J., Blair, R. W., Moodie, C. A., Isik, A. I., Erramuzpe, A., Kent, J. D., Goncalves, M., DuPre, E., Snyder, M., Oya, H., Ghosh, S. S., Wright, J., Durnez, J., Poldrack, R. A., & Gorgolewski, K. J. (2019). fMRIPrep: a robust preprocessing pipeline for functional MRI. Nature Methods, 16(1), 111–116. doi:10.1038/s41592-018-0235-4 (read 2026-11-08).

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about fMRIPrep: Neuroimaging Preprocessing Guide

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →