Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

54
Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami

Transcript of Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Page 1: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Source localization for EEG and MEG

Methods for Dummies 2006

FILBahador Bahrami

Page 2: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Before we start …

• SPM5 and source localization: • On-going work in progress

• MFD and source localization:• This is the first on this topic

• Main references for this talk: • Jeremie Mattout’s slides from SPM course • Slotnick S.D. chapter in Todd Handy’s ERP handbook • Rimona Weil’s wonderful help (thanks Rimona!)

Page 3: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Outline

• Theoretical• Source localization stated as a problem • Solution to the problem and their limitations

• Practical*• How to prepare data • Which buttons to press• What to avoid • What to expect

* Subject to change along with the development of SPM 5

Page 4: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Source localization as a problem

Page 5: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

+

-

Page 6: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

+ -

Page 7: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Any field potential vector could be consistent with an infinite number of possible dipoles

The possibilities only increase with tri-poles and quadra-poles

+-

+ -

Page 8: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

ERP and MEG give us

Page 9: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

And source localization aims to infer

+-

among

Page 10: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

How do we know which one is correct?

+-

+ -

We can’t. There is no correct answer.

We can only see which one is better

Can we find the best answer?

Source localization is an ILL-DEFINED PROBLEM

Only among the alternatives that you have considered.

Page 11: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

HUNTING for best possible solution

Step ONE: How does your data look like?

MEG sensor locationMEG sensor location

MEG dataMEG data

Source ReconstructionRegistration

Page 12: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

HUNTING for best possible solution

If then

If then

If then

If then

And on and on and on and …

FORWARD MODEL

Step Two

Page 13: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

HUNTING for best possible solution

Forward Model Experimental DATA

Which forward solutions fit the DATA better (less error)?

Inverse Solution

Page 14: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

HUNTING for best possible solution

Forward

Inverse Solution

DATA

Iterative ProcessUntil solution stops getting better (error stabilises) iteration

erro

r

Page 15: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Components of the source reconstruction process

Source modelSource model

Forward modelForward model

Inverse methodInverse method

RegistrationRegistration

‘Imaging’‘Imaging’‘ECD’‘ECD’

DataData AnatomyAnatomy

Page 16: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Recipe for Source localization in SPM5

• Ingredients– MEG converter has given you

• .MAT data file (contains experimental data)

• sensloc file (sensors locations)

• sensorient (sensors orientations)

• fidloc (fiducial locations in MEG space)

– fidloc in MRI space (we will see shortly)

– Structural T1 MRI scan

All in the same folder

Page 17: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

fidloc in MRI space

Nasion

Left Tragus

Right Tragus

X

X

X

Y

Y

Y

Z

Z

Z

Nasion Nasion

Left Tragus

Left Tragus

Right Tragus Right Tragus

Get these using SPM Display button

Save it as a MAT file in the same directory as the data

Page 18: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 19: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Components of the source reconstruction process

Source modelSource model Forward modelForward model Inverse solutionInverse solutionRegistrationRegistration

Page 20: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Source modelSource model

Page 21: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Source model

TemplatesTemplatesIndividual MRIIndividual MRI

Compute transformation TCompute transformation T

Apply inverse transformation T-1Apply inverse transformation T-1

Individual meshIndividual mesh

- Individual MRI- Template mesh

- spatial normalization into MNI template- inverted transformation applied to the template mesh

- individual mesh

functions output

Page 22: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 23: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 24: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 25: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 26: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Scalp Mesh

iskull mesh

Page 27: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Components of the source reconstruction process

RegistrationRegistration

Page 28: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Registration

Rigid transformation (R,t)Rigid transformation (R,t)

Individual MRI spaceIndividual MRI space

fiducials

Individual sensor spaceIndividual sensor space

fiducials

- sensor locations- fiducial locations(in both sensor & MRI space)- individual MRI

input

- registration of the EEG/MEG data into individual MRI space

- registrated data- rigid transformation

functions output

Page 29: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 30: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 31: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 32: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Forward modelForward model

jmattout
In SPM5, the Imaging pipeline requires processing the four main steps successively:- Source modelDefining a cortical mesh of dipoles for a given individual- Registrationis independent of the source model... so could be performed before- Forward modelrequires the two previous step to have been completed- Inverse solutionrequires the three previous componentsLet's consider those steps one by one...
Page 33: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Foward model

Compute foreach dipole

Compute foreach dipole

Individual MRI spaceIndividual MRI spaceModel of the

head tissue properties

Model of thehead tissue properties

+

Forward operatorForward operator

Kn

- sensor locations- individual mesh

input - single sphere- three spheres- overlapping spheres- realistic spheres

- forward operator K

functions

output

BrainStorm

Page 34: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 35: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 36: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Inverse solutionInverse solution

jmattout
In SPM5, the Imaging pipeline requires processing the four main steps successively:- Source modelDefining a cortical mesh of dipoles for a given individual- Registrationis independent of the source model... so could be performed before- Forward modelrequires the two previous step to have been completed- Inverse solutionrequires the three previous componentsLet's consider those steps one by one...
Page 37: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Inverse solution (1) - General principles

1 dipole sourceper location

Cortical meshCortical mesh

General Linear Model

Y = KJ+ E[nxt] [nxp] [nxt][pxt]

n : number of sensorsp : number of dipolest : number of time samplesUnder-determined GLMUnder-determined GLM

Regularized solutionRegularized solution J : min( ||Y – KJ||2 + λf(J) )J

data fit priors

^

jmattout
We consider one dipole per location and is oriented perpendicularly to the surface (following the orientation of the cortical neuron dendrites).(I am thinking of proposing also a three-dipoles per location model, but not in the first release of the toolbox)In Imaging, the problem comes down to a GLM formulation that one has to invert.Contrarery to the fMRI GLM, this one is higly under-determined since p >> n.Regularization is required, which consists of minimizing a twofold criterion made of a data fit term and a prior term.To give rise to a realistic and reliable solution, the prior term needs to be defined carefully and the two terms have to be optimally relatively weighted.
Page 38: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Inverse solution (2) - Parametric empirical Bayes

2-level hierarchical model

E2 ~ N(0,Cp)

E1 ~ N(0,Ce)Y = KJ + E1

J = 0 + E2

Sensor levelSensor level

Source levelSource level

Gaussian variableswith unknown variance

Gaussian variableswith unknown variance

Linear parametrization of the variances

Linear parametrization of the variances

Gaussian variableswith unknown variance

Gaussian variableswith unknown variance

Ce = 1.Qe1 + … + q.Qe

q

Cp = λ1.Qp1 + … + λk.Qp

kQ: variance components(,λ): hyperparameters

Q: variance components(,λ): hyperparameters

jmattout
SPM uses a Parametric empirical Bayesian approach, based on the following 2-level hierarchical model:- 1st level, the previous GLM- 2nd level, the unknown source parameters are considered as a gaussian random variable with zero mean (shrinkage prior) and unknown variance.Contrary to the classical Minimum Norm or Weighted Minimum Norm approach, the noise and source variances are considered unknown and are estimated together with the source amplitudes.Therfore, the variances are parameterized as a linear combination of variance components.- At the sensor level, several variance components can be considered such as an identity matrix (noise i.i.d), an empirical estimate of the noise variance (rest acquisition and/or data anti-averaging)- At the source level, all sorts of prior which can be expressed in terms of variance component can be incorporatedThe corresponding weights or hyperparameter are estimated in the PEB approach.
Page 39: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Inverse solution (3) - Parametric empirical Bayes

Bayesian inference on model parameters

Inference on J and (,λ)Inference on J and (,λ)

Model MModel MQe

1 , … , Qeq

Qp1 , … , Qp

k+J K

+,λ

F = log( p(Y|M) ) = log( p(Y|J,M) ) + log( p(J|M) ) dJ

E-step: maximizing F wrt J J = CJKT[Ce + KCJ KT]-1Y^

M-step: maximizing of F wrt (,λ) Ce + KCJKT = E[YYT]

Maximizing the log-evidenceMaximizing the log-evidence

data fit priors

Expectation-Maximization (EM)Expectation-Maximization (EM)

MAP estimateMAP estimate

ReML estimateReML estimate

jmattout
Given a model M, PEB provides inference on the parameters and hyperparameters of M.Note that M is defined by the source model (associated with J, the mesh and its particular size), the forward calculation attached to it and the considered variance components.Inference is made by maximizing the log-evidence (maybe you should show what is the evidence in the Bayes law !?). In the formulation of the log-evidence one recognizes the two terms of a regularization process.In SPM, this is solved using an iterative EM algorithm.The E-step provides the Maximum A Posteriori estimate of the source amplitudes.The M-step provides the ReML estimates of the hyperparameters, accounting for the loss of degrees of freedom due to the E-step and so that the predicted data covariance matrix should fit the empirical data covariance best.Importantly, the PEB approach enables the user to accomodate multiple priors and to weight their contribution optimally, according to the data (data-driven estimate of the hyperparameters, contrary to the classical and so-called L-curve approach).
Page 40: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Inverse solution (4) - Parametric empirical Bayes

Bayesian model comparison

B12 =p(Y|M1)p(Y|M2)

Model evidenceModel evidence

• Relevance of model M is quantified by its evidence p(Y|M) maximized by the EM scheme

Model comparisonModel comparison

• Two models M1 and M2 can be compared by the ratio of their evidence

Bayes factorBayes factor

Model selection using a‘Leaving-one-prior-out-strategy‘

Model selection using a‘Leaving-one-prior-out-strategy‘

jmattout
Finally, given a particular data set, PEB allows evaluating the relevance of the model M. Indeed, the higher the maximized log-evidence, the more relevant the model.Then, model comparison can be performed and two models can be quantatively compared using their Bayes factor (the ratio of their log-evidence). The Bayes factor can then be interprated probabilistically as proposed by Kass & Raftery (1995) or as done with DCMs (Penny 2004). For instance, if B12 = 1, there's no evidence in favor of any of the model. If B12 > 20, there is a strong evidence in favor of model M1.This becomes very useful for chosing the optimal sets of priors.Indeed, based on Bayes factor, one can adopt a 'Leaving one out strategy' and thus evaluate the effect of each prior and finally chose the prior model which yields the higher evidence.
Page 41: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Inverse solution (5) - implementation

- preprocessed data- forward operator- individual mesh- priors

input

- compute the MAP estimate of J- compute the ReML estimate of (,λ)- interpolate into individual MRI voxel-space

- inverse estimate- model evidence

functions output

- iterative forward and inverse computation

ECD approach

jmattout
Well, just read the slide more or less... with a mention of Christophe's approach that will be also available. Note that for the ECD approach, the foward operator will have to be recomputed along the iterative inverse process.Note also that interpolation from the mesh to the MRI voxels can be performed... then enabling to derive SPMs.Thanks to the use of a template mesh, this can be easily performed directly into the MNI template for inter-subject comparison or group analysis.
Page 42: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

HUNTING for best possible solution

Forward

Inverse Solution

DATA

Iterative ProcessUntil solution stops getting better (error stabilises) iteration

erro

r

Page 43: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 44: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Types of Analysis

• Evoked– The evoked response is a reproducible response which occurs after each

stimulation and is phase-locked with the stimulus onset.

• Induced– The induced response is usually characterized in the frequency domain and

contrary to the evoked response, is not phased-locked with the stimulus onset.

• The evoked response is obtained (on the scalp) as the stimulus or event-locked average over trials. This is then the input data for the 'evoked' case in source reconstruction.

• One can also reconstruct the evoked power in some frequency band (over the time window), this is what is obtained when choosing 'both' in source reconstruction.

Jeremie says:

Page 45: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 46: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 47: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 48: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 49: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 50: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.
Page 51: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Conclusion - Summary

Data spaceData space MRI spaceMRI space

RegistrationRegistration

Forward modelForward model

EEG/MEG preprocessed data

EEG/MEG preprocessed data

PEB inverse solution

PEB inverse solution

SPMSPM

jmattout
Well, I guess you just need to rephrase and summarize the whole pipeline.Note that the approach yields equivalently to SPMs in individual or template space as well as to PPMs (Guillaume's talk on PPMs will just preceed yours on source localization).A group analysis is also possible, well everything which SPM_EEG offers can be applied...Bravo!
Page 52: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Important!

Source model

Source model

Forward model

Forward model

Inverse solution

Inverse solution

Registration

Registration

The same for all conditions.

Therefore, only done ONCE for each subject

Repeated for each condition

jmattout
In SPM5, the Imaging pipeline requires processing the four main steps successively:- Source modelDefining a cortical mesh of dipoles for a given individual- Registrationis independent of the source model... so could be performed before- Forward modelrequires the two previous step to have been completed- Inverse solutionrequires the three previous componentsLet's consider those steps one by one...
Page 53: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Considerations

• Source localization project is still ongoing

• Unable to incorporate prior assumptions about source (e.g., from fMRI blobs)

• Source localization only for conditions

• Not for contrasts

• Source localization is a single subject analysis (no way to look at group effects)

Page 54: Source localization for EEG and MEG Methods for Dummies 2006 FIL Bahador Bahrami.

Thank you Rimona!

Thank you MFD!