and the role of horses in the history of
Wellcome Trust Centre for Neuroimaging
UCL Institute of Neurology
At the beginning there was a horse
Berger originally had intended to study
astronomy. While he was serving in the German
army in the early 1890s, his horse slipped down
an embankment, nearly seriously injuring Berger.
His sister many miles away had a feeling he was
in danger and got her father to telegram him. This
astonished him so much that he switched to study
Hans Berger (Blakemore, 1977)
What do we need?
(sampling frequency and onset) Sensor locations
Evoked response vs. spontaneous activity
evoked response ongoing rythms
MEG EEG Arbitrary Fieldtrip
CTF EEGLAB ASCII raw
Neuromag Biosemi Matlab timelock
*.dat – binary data file
*.mat – header file
• The *.mat file contains a struct, named D, which is
converted to an meeg object by spm_eeg_load.
• The *.dat file is memory-mapped and linked to the
• Special functions called ‘methods’ provide a
simple interface for getting information from the
object and updating it and ensure that the header
data remain consistent.
Now lets take a step back
• Requires quite complex sensor representation including locations and
orientations of the coils and the way MEG channels are derived from
• Sensor representation is read automatically from the original dataset at
• Presently only requires electrode locations. In the future will also
include a montage matrix to represent different referencing
• Usually electrode locations do not come with the EEG data.
• SPM assigns default electrode locations for some common systems
(extended 10-20, Biosemi, EGI – with user’s input).
• Individually measured locations can be loaded; requires co-registration.
Understanding coordinate systems
Coordinate systems can differ in their origin, units and orientation.
• MNI coordinates are defined using landmarks inside the brain.
– Advantage: locations can be related to anatomy
– Disadvantage: co-registration to a structural scan is required
• Head coordinates are defined based on the fiducials. Commonly used
for MEG, but the definition differs between different MEG systems.
– Advantage: once the location of the head is expressed in head coordinates,
it can be combined with sensor locations even if the subject moves.
– Disadvantage: requires fiducials; if the fiducials are moved, the coordinate
• Device coordinates are defined relative to some point external to the
subject and fixed with respect to the measuring device.
– Advantage: head locations can be compared between different
experiments and subjects.
– Disadvantage: head location needs to be tracked.
Understanding coordinate systems
• Before co-registration
– MEG sensors are represented in head coordinates in
– EEG sensors can be represented in any Cartesian
coordinate system. Units are transformed to mm.
• After co-registration
– MEG sensor representation does not change. The head
model is transformed to head coordinates.
– EEG sensors are transformed to MNI coordinates.
Definition: Cutting segments around events.
Need to know:
• What happens (event type, event value)
• When it happens (time of the events)
Need to define:
• Segment borders
• Trial type (can be different triggers => single trial type)
• SPM8 only supports fixed length trials (but there are ways to
• The epoching function also performs baseline correction (using
negative times as the baseline).
• High-pass – remove the DC offset and slow trends in the
• Low-pass – remove high-frequency noise. Similar to
• Notch (band-stop) – remove artefacts limited in frequency,
most commonly line noise and its harmonics.
• Band-pass – focus on the frequency of interest and
remove the rest. More suitable for relatively narrow
Filtering - examples
Unfiltered 5Hz high-pass 10Hz high-pass
45Hz low-pass 20Hz low-pass 10Hz low-pass
EEG – re-referencing
EEG – re-referencing
• Re-referencing can be used to sensitize sensor
level analysis to particular sources (at the
expense of other sources).
• For other purposes (source reconstruction and
DCM) it is presently necessary to use average
reference. This will be relaxed in the future.
• Re-referencing in SPM8 is done by the Montage
function that can apply any linear weighting to the
channels and has a wider range of applications.
• SPM8 has an extendable artefact detection
function where plug-ins implementing different
detection methods ca be applied to subsets of
• Presently, amplitude thresholding, jump detection
and flat segment detection are implemented.
• Plug-in contributions are welcome.
• In addition, topography-based artefact correction
method is available (in MEEGtools toolbox).
Averaging - horses, once again.
In the 1870s Sir Francis Galton (1822-1911),
became the first scientific sportsman. He
derived the common facial features of
winning horses by photographically
superimposing heads of race-winning
thoroughbreds. In addition to its innovation to
sports, this is a first in the extraction of
common features and blurring of noise.
Encouraged by his horse racing success
Galton went on to identify the common
physical features in the faces of violent
criminals and murderers of the 1880s. He
hoped to be able to detect potential violent
offenders before they committed their crimes.
He superimposed photographs to obtain
composites that, in this case, turned out to be
nothing out of the ordinary.
Kilner, in prep. 2009
• Robust averaging is an iterative procedure that
computes the mean, down-weights outliers, re-
computes the mean etc. until convergence.
• It relies on the assumption that for any channel and
time point most trials are clean.
• The number of trials should be sufficient to get a
distribution (at least a few tens).
• Robust averaging can be used either in combination
with or as an alternative to trial rejection.
So that’s how we got to this point
What is the crucial difference
between M/EEG and fMRI
from the point of view of
How can we characterize this?
• Joseph Fourier (1768-1830)
• Any complex time series can be broken
down into a series of superimposed sinusoids
with different frequencies
Methods of spectral estimation – example 1
Morlet 3 cycles Hilbert transform
Morlet 5 cycles
Morlet 7 cycles Multitaper
Methods of spectral estimation – example 2
Morlet 5 cycles Morlet w. fixed window
Morlet 7 cycles Optimized multitaper Hilbert transform
Morlet 9 cycles Multitaper
Robust averaging for TF
The people who contributed material to
this presentation (knowingly or not):
• Stefan Kiebel
• Jean Daunizeau
• Gareth Barnes
• James Kilner
• Robert Oostenveld
• Hillel Pratt
• Arnaud Delorme
• Laurence Hunt
and all the members of the methods group past and present