Elements of fMRI Analysis
Hands-on companions to Elements of Functional Magnetic Resonance Imaging — concepts, runnable code in MATLAB and Python, thought questions, and self-quizzes for every chapter.
The tutorials
From first principles to predictive models — learn fMRI analysis by doing it.
Every chapter of the book has a companion page here: the key concepts distilled, worked examples you can run and modify, discussion questions for classes and journal clubs, and quizzes to check your understanding.
- Chapters
- 42, in 7 parts
- Languages
- MATLAB & Python
- Runs
- In your browser
- Cost
- Free & open
Seven parts
The arc of the book
Motivation
Why fMRI: an open, versatile tool for studying the human brain — and what it means for science and society.
Brain Mapping
Inferences about mind, brain, and behavior — forward and reverse inference, and what we can and cannot conclude.
MRI & the Signal
The scanner environment, MRI physics, BOLD physiology, and the resolution limits of what we measure.
Analysis Fundamentals
Preprocessing, the GLM, group analysis, multiple comparisons, interpretation, and meta-analysis — the core toolkit.
Experimental Design
Causality, task design and optimization, resting-state designs, and the statistical power to find real effects.
Brain Connectivity
Functional connectivity, PCA and ICA, network analysis, and dynamic and causal models of interacting regions.
Predictive Modeling
From maps to models: machine learning, training and testing, biomarkers, and where AI meets neuroscience.
Run the code
Three ways to run every exercise
No installation, no accounts, no servers to wait for — unless you want the full experience on your own machine.
In your browser
Python runs right on this site via WebAssembly. Nothing to install, works for everyone, from simulations to GLM fitting.
In the cloud
Open any notebook in Google Colab, or MATLAB exercises in MATLAB Online with CANlab tools set up automatically.
On your machine
Download notebooks and live scripts to run locally with nilearn or the CANlab MATLAB toolbox — the same tools used in research.
The book
Elements of Functional Magnetic Resonance Imaging
By Tor D. Wager & Martin A. Lindquist. A guide for practitioners of fMRI across fields: the principles underlying acquisition and analysis, common errors and pitfalls, and emerging techniques — from two researchers who have taught the "nuts and bolts" of fMRI for over twenty years.