fMRI tutorials with Matlab Live Scripts
This series of walkthroughs is designed to illustrate the principles of fMRI acquisition, design, and analysis. They use the CANlab Core interactive analysis tools. Code to run each walkthrough is included in the CANlab Core toolbox, and datasets are included or downloaded from Neurovault. See the main CANlab intro page for more on the philosophy behind the interactive analysis approach.
This is not a comprehensive introduction to Matlab. It’s assumed that you will use other resources to supplement your basic understanding how to work with Matlab, including:
- Matlab’s comprehensive built-in examples (type “doc” within Matlab)
- Function help (type “help my_fun”, where my_fun is the name of a function)
- Matlab Academy (free!), including the “Matlab Onramp” module and others)
- Other great resources, e.g., Michael X. Cohen’s YouTube lectures and Matlab book, Kendrick Kay’s Matlab-based stats course
These are didactic tutorials using Matlab live scripts. There is also a complementary set of code walkthroughs on using the CANlab object-oriented tools, with some overlap but unique information and code examples.
Basic signal processing | |
---|---|
1.1. T1 decay and basic Matlab orientation | Download Matlab Live Script |
1.2. Sine waves, aliasing, and the Fourier Transform | Download Matlab Live Script |
First-level models with whole-brain data | |
---|---|
3.1. Setting SPM defaults | Download Matlab Live Script |
Get the Pinel localizer dataset used here or on Dropbox here (Neurospin version) or here (BIDS) | |
3.2. Preprocessing basics using SPM | Download Matlab Live Script |
3.3. First-level model using the SPM GUI | Download Matlab Live Script |
3.4. First-level model using CANlab regress() | Download Matlab Live Script |
3.5. Parametric modulators with variable event durations | Download Matlab Live Script |
Second-level models with CANlab tools | |
---|---|
4.1. Second-level model using CANlab robust regression toolbox | Download Matlab Live Script |
See also walkthroughs |
Multivariate predictive models | |
---|---|
Datasets (On Dropbox; See also links in tutorials) | Paper links |
Kragel270 fmri_data object | Paper |
BMRK3 pain dataset fmri_data object | Paper |
Rejection vs Pain dataset | Paper and this |
Tutorials | |
3.1. SVM on unpaired data using predict() | Download Matlab Live Script |
3.2. multivariate prediction with continuous outcomes |