name: title layout: true class: cover title-slide --- count: false counter: false .pull-left[
] .pull-right.center[
.boxed-content[ # Compute Once, Reuse Forever ## Sustainable Science with NiPreps *Christopher J. Markiewicz* .smaller[<markiewicz@stanford.edu>] ] ] ??? --- name: nofooter layout: true .perma-sidebar[
Compute Once, Reuse Forever — OHBM Educational (June 14
th
, 2026)
] --- name: footer-nobar template: nofooter layout: true .footer[ .footer-logo-row[
] ] --- name: footer template: nofooter layout: true .footer[ .footer-logo-row[
] .footer-bar[] ] --- .section-mark[ ## OHBM 2026 DISCLOSURES I have no conflicts of interest in relation to this presentation to disclose. ] --- exclude: true counter: false .section-mark.center[ # Open data ] --- # Open data can be big or small .pull-left[ Consortium datasets are characterized by large numbers of subjects: | Dataset | Subjects | Sessions | Tasks | |-------|----------|----------|-------| | UK Biobank | 67k | 1-2 | 2 | | ABCD | 11.8k | 1 | 5 | | HCP-YA | 1.2k | 1 | 8 | | ABIDE (I+II) | 2.2k | 1 | 1 | | ... | These datasets generally collect limited data per-subject. ] -- .pull-right[ There is a "long tail" of datasets with smaller numbers of subjects (N<50), but more tasks and deeper phenotyping:
Markiewicz et al. (2021) Fig 3 - Summary of datasets in OpenNeuro
] ??? We heard in the NeuroBagel talk about discovering datasets to address new questions. But how do we actually use these datasets together? --- # Heterogeneous datasets introduce analytical challenges .pull-left[
.small[ *The Turing Way project* illustration by Scriberia. Used under a CC-BY 4.0 licence. doi:
10.5281/zenodo.3332807
.] ] -- .pull-right.larger[ Variation arises from differences in: - Subjects / states - Recording hardware/software - Preprocessing choices - Preprocessing implementations - Analytical choices Especially pronounced when combining across datasets. ] --- # Standardized, robust preprocessing is a targeted solution .center.small[
[Esteban et al., (2020)](http://doi.org/10.1038/s41596-020-0327-3); [Niso et al., (2022)](https://doi.org/10.1016/j.neuroimage.2022.119623) ] -- .larger[
Data collection is **done**. You've selected your datasets and filtered your subjects. ] -- .larger[
Statistical modeling is full of **necessary** choices. ] -- .larger[
Preprocessing is an **opportunity** to control flexibility and harmonize the data. It should be: ] * **Robust**: Work on a wide variety of inputs without failing. * **Standardized**: It applies the same logic to every dataset. * **Transparent**: Reproducible and *inspectable*. ??? --- # fMRIPrep is robust, standardized, and minimal .boxed-content.center[
] ??? A few years ago, we introduced fMRIPrep, a minimal, robust, and standardized preprocessing pipeline for fMRI. --- count:false class: stepwise-svg # fMRIPrep is robust, standardized, and minimal .boxed-content.center[
] ??? What do I mean by that? The pipeline is robust in that it has minimal requirements (T1w and BOLD images), but adaptive in that it can utilize additional scans when available (e.g. fieldmaps, T2w images, additional echos). And it's standardized in the sense that it accepts BIDS formatted datasets, makes processing decisions based on the discovered metadata, and produces outputs in standardized formats for further processing. It is minimal in that it is agnostic to downstream analysis, so it refrains from spatial smoothing or temporal filtering. Natural divisions in workflow: * Structural * Functional * ... --- count:false # fMRIPrep is robust, standardized, and minimal .boxed-content.center[
] ??? Natural divisions in workflow: * Structural * Functional * Fieldmap * Template selection Diffusion, ASL: Reuse all but functional PET: Reuse structural, templates --- # NiPreps is an ecosystem of preprocessing workflows .pull-left.center[
] .pull-right.larger[ Building off the success of fMRIPrep, NiPreps are: * **BIDS first** — query datasets and adapt * **Minimal** — stop where consensus stops, emit analysis-agnostic derivatives * **Self-reporting** — visual reports, citation boilerplate ] -- .pull-right.larger[ The NiPreps follow a "**glass-box**" design philosophy. Users are expected and empowered to understand the processing that is done. ] --- exclude: true # NiPreps design principles * Input: BIDS-formatted data. * Process: Intelligently adapts to available data (e.g., uses field maps if present, but doesn't fail if not). This robust design is key to handling heterogeneity. * Output: BIDS Derivatives including: 1. Intuitive visual QC reports. 1. Analysis-agnostic derivatives (confounds, brain masks). 1. Reusable, pre-computed transformations. (This sets the stage for the next slide). --- # Visual reports reflect the stages and quality of processing .boxed-content[ .small[https://fmriprep.s3.amazonaws.com/bootcamp-geneva-2024/sub-15.html]
] --- # There's a missing division... .boxed-content.center[
] ??? --- # Fit+transform isolates expensive or probabilistic work .boxed-content.center[
] ??? * Concept: We separate expensive computation from flexible application. * FIT (Compute-Heavy): Run once. Example: Calculating the complex nonlinear registration from a subject's T1w to a template. This is slow and difficult. The result is a set of warp files. * TRANSFORM (Lightweight): Run as needed. Example: Using that warp to resample a BOLD file into the template space. This is fast and easy. * Key Message: NiPreps does the heavy "fitting" for you. You can then perform the lightweight "transform" to any space you need, on demand. --- # Fit+transform makes efficient use of limited resources .boxed-content[ .larger[*Minimal mode* (added in 23.2) excludes ouptuts that can be regenerated deterministically.]
File counts in minimal mode reduced by 32% over the previous version, and total file size by 83%. ] -- .boxed-content[
Including the work directory, file counts dropped by 78% and total size by 89%. ] --- exclude: true # NiPreps and the FAIR principles * Interoperability (I): Outputs are in BIDS Derivatives format, a community standard. * Reusability (R): The "Fit+Transform" model makes derivatives radically more reusable. Instead of one giant, pre-packaged output, you get flexible components to build your desired final product. --- counter: false .section-mark.center[ # NiPreps in Practice ## Three perspectives ] --- # Perspective: Dataset creators .boxed-content.larger[ You're getting ready to share your dataset so others can reproduce your results and run their own (meta-)analyses. Sharing derivatives saves computation and reduces scope of methodological variation.
] -- .larger[ **Options** Share full derivatives
Straightforward, familiar, might run into space limits ] -- .larger[ Share raw data and minimal derivatives
More space efficient, may need to update scripts ] -- .larger[ **Tip** Register to a couple common templates
Good storage to benefit trade-off ] --- # Perspective: Secondary analyst .boxed-content[ .larger[ You've found a dataset with minimal derivatives. Well now what? ] .center.large[https://github.com/nipreps/fmriprep-resampling-demo]
] -- .larger[ **Options** Run fMRIPrep with derivatives as inputs
Recreate full results, some unnecessary computation ] -- .larger[ Resample data in your script or workflow
Only necessary outputs, some assembly required ] -- .larger[ Use fMRIPost workflows
Accept minimal derivatives, if they do what you want ] --- # Perspective: Data archivist / system administrator .larger[ You manage a data archive or compute cluster for your lab or institute. Storing full derivatives is becoming costly, and many datasets are rarely accessed.
] -- .larger[ **Options** Store minimal derivatives
A clear win, but more user support may be needed ] -- .larger[ **Tip** Full derivatives can be recomputed and cached
Savings with heavily/widely-used datasets ] -- .larger[ Workflow engines may have caching facilities
With a global cache, the first user pays the cost ] ??? * Goal: Balance cost and value. * The Takeaway: "Having seen how powerful and flexible the minimal 'fit' derivatives are, the archivist's choice is clear. Storing these small warp files instead of huge, pre-resampled 4D images is a massive win for storage costs, transfer bandwidth, and long-term reusability." * QR --- # Compute Once, Reuse Forever .boxed-content.larger[ * Heterogeneous, open datasets provide opportunities for novel meta-/mega-analyses * NiPreps pipelines can control flexibility with standardized, robust preprocessing * The fit+transform model enables efficient sharing of data that balances reproducibility and storage/bandwidth costs ] ??? --- .section-mark.center[ # Thank you! ] --- template: title .center.middle.black[   ]