Mathematics for Brain Imaging


Autumn Term, 2006



This lecture series covers a number of mathematical methods that are used in the analysis of brain imaging data. Each lecture describes a different category of model and shows how it is applied to a particular aspect of brain imaging analysis. The applications cover data from functional Magnetic Resonance Imaging (fMRI), Magnetoencephalography (MEG) and Electroencephalography (EEG).


When ? Weds 11am-1pm (unless otherwise stated), October 4th to Dec 13th 2006


Where ? FIL Seminar Room, 4th floor, 12 Queen Square



Download all course notes: mbi_course.pdf





  1. General Linear Models I
  2. General Linear Models II
  3. Random Field Theory
  4. Multivariate Models
  5. Variance Components
  6. Bayesian methods
  7. Model comparison
  8. Spectral Estimation
  9. Approximate Bayesian Inference
  10. Nonlinear models






1. General Linear Models I

    • Maximum likelihood estimation
    • Regression and correlation
    • Linear algebra
    • Functions of random vectors
    • Multiple regression and partial correlation
    • Application: fMRI time series


Lecture notes and code can be downloaded from this archive:


2. General Linear Models II

    • Estimating error variance
    • Comparing nested models
    • Transforming probability densities
    • Contrasts
    • Hemodynamic basis functions
    • Application: fMRI time series


Notes can be downloaded here: lecture2.pdf, contrasts.pdf,

and code: mc.m, temporal.m


3. Random Field Theory

    • Gaussian processes
    • Covariance functions
    • Upcrossings of one-dimensional processes
    • Euler characteristic
    • Application: Detecting activations in fMRI data


Notes can be downloaded here: lecture3.pdf

Code for 1-dimensional GPs: demo_1d.m, init_gp_1d.m

Keith Worsley’s introduction to the Euler Characteristic: chance3.pdf

Matthew Brett’s simulation of 2D fields: randomtalk.m


4. Multivariate Models

    • More Linear Algebra
    • Principal component analysis
    • Singular Value Decomposition
    • Structural Equation Modelling
    • Granger causality
    • Application: PET & fMRI connectivity analyses


Notes can be downloaded here: lecture4.pdf

Notes on Granger causality and MAR models: mar.pdf

Code and data for SVD image compression: ALAN02.JPG, alan_svd.m

Code for PCA extraction of representative regional activity:  region_svd.m


5. Variance Components

    • GLMs with arbitrary error covariance
    • Weighted Least Squares
    • Restricted Maximum Likelihood
    • Application: fMRI time series analysis with correlated errors
    • Hierarchical Models
    • Application: Analysis of imaging data from a group



Notes can be downloaded here: lecture5.pdf

Code for ReML estimation of variance components

in a hierarchical model: group_study.m



6. Bayesian methods

    • Bayes rule for Gaussians
    • Bayesian GLMs
    • Parametric Empirical Bayes (PEB)
    • Expectation Maximisation (EM)
    • Application: EEG source reconstruction


Notes can be downloaded here: lecture6.pdf

Code for EM example: em1.m

The equations in the EM example can be derived as shown here: ..\publications\spm-book\hierarchical.pdf



7. Model comparison

    • Bayes factors and odds ratios
    • Model evidence for Bayesian GLMs
    • Accuracy and complexity (AIC/BIC)
    • Bias-variance decomposition
    • Application: EEG source reconstruction
    • Bayesian model averaging
    • Application: Nonlinear EEG source reconstruction


Notes can be downloaded here: lecture7.pdf


8. Spectral Estimation

    • Fourier series and periodograms
    • Autocorrelation and power spectral density
    • Cross-correlation and cross spectral density
    • Coherence and Phase
    • Welch and multitaper methods
    • Localisation of MEG Gamma activity


Notes can be downloaded here: lecture8.pdf

Sunspot data: yearssn, and code for analysing it here: sunspot_spectra.m

Notes on autoregressive,, and subspace methods for spectral estimation,


9. Approximate Bayesian Inference

    • Laplace approximation
    • Kullback-Liebler divergence
    • Variational Bayes and EM
    • Mixture models
    • Application: Group analysis of imaging data


Notes can be downloaded here: lecture9.pdf



10. Nonlinear models

    • Central Limit Theorem
    • Independent Component Analysis
    • Application: EEG artifact removal
    • Discriminant Analysis
    • Application: Estimating perceptual state from fMRI


Notes can be downloaded here: lecture10.pdf