Q: recently I have some inqueries about the Sourcemodel and leadfiled, there is a little confusion in filedtrip toturial, especially for the beginners , here we could give some general idea how about the flow of making a leadfiled with different source construcation method

source estimation comprises two major steps:

(1) Estimation of the potential or field distribution for a known source and for a known model of the head is referred to as **forward modeling**.

(2) Estimation of the unknown sources corresponding to the measured EEG or MEG is referred to as **inverse modeling**.

The forward solution can be computed when the head model, the channel positions and the source is given.

For distributed source models and for scanning approaches (such as beamforming), the source model is discretizing the brain volume into a volumetric or surface grid.

When the forward solution is computed, the **lead field matrix** (= channels X source points matrix) is calculated for each grid point taking into account the head model and the channel positions.

We have three kind of source reconstucation emthod :

**dipole fit**

When you do source reconstruction with dipole fit methods, you usually assume a source model that consists of a single or a small number of equivalent current dipoles and you fit the source location, orientation and strength to the data

**beamformer**

When doing source reconstruction with beamformers, people typically scan the brain volume where dipoles are defined on a regular 3D grid, with a regular spacing between the dipole locations. These grids are usually optimized to the individual anatomy of the participant.

**distributed**

When doing source reconstruction using minimum norm estimation (MNE, also known as linear estimation) techniques, the assumption is that the sources in the brain are distributed and that only the strength at all possible cortical locations is to be estimated.

1. headmodel

the same name with Volume conduct, The head model (vol) contains the brain-skull boundary as the geometrical description of the head,

It describes how the currents flow through the tissue, not where they originate from.

In general it consists of a description of the geometry of the head, a description of the conductivity of the tissue, and mathematical parameters that are derived from these.

Whether and how the mathematical parameters are described depends on the computational solution to the forward problem either by numerical approximations, such as the boundary element and finite element method (BEM and FEM), or by exact analytical solutions (e.g. for spherical models).

```
For EEG the following methods are available:
openmeeg boundary element method, based on the OpenMEEG software
bemcp boundary element method, based on the implementation from Christophe Phillips
I do recommend to use OpenMEEG or Bemcp for EEG.
%% example code
```

cfg = []; cfg.method='bemcp'; vol = ft_prepare_headmodel(cfg, mri); Filedtrip has the standern bem vol in the template folder, or you could make one with you own hand . for tutorial :http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem

2. source model

Depending of the source reconstruction algorithm you want to use, you have to a priori specify a model that describes the locations of the sources (and sometimes the orientation) that you want to take into account. Specifically, this pertains to distributed source modelling approaches (e.g. Minimum Norm Estimation procedures), and for scanning approaches (e.g. beamformers). Dipolefitting approaches in general do not require an a priori source model (apart from when you want to use the option ‘gridsearch’). In general, one could construct a source model that defines positions of dipoles on a 3-dimensional grid (this is sometimes referred to as a volumetric source model), or on a 2-dimensional surface (typically the cortical sheet).

**dipole fit: **

no sourcemodel is needed

**beamformer: **

Dynamical Imaging of Coherent Sources (DICS) and the estimates are calculated in the frequency domain (Gross ET al. 2001). Other beam-former methods rely on sources estimates calculated in the time domain, e.g. the Linearly Constrained Minimum Variance (LCMV) and Synthetic Aperture Magnetometry (SAM) methods (van Veen et al., 1997; Robinson and Cheyne, 1997). These methods produce a 3D spatial distribution of the power of the neuronal sources.

**distributed**

minimum norm estimation

%% example code

cfg = []; cfg.grid.resolution = 1; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.headmodel = template_headmodel; template_grid = ft_prepare_sourcemodel(cfg);

3. leadfeild

discretize the brain volume into a grid. For each grid point the lead field matrix is calculated

cfg = []; cfg.grad = freq; cfg.headmodel = headmodel; cfg.reducerank = 2; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; [grid] = ft_prepare_leadfield(cfg);

Be careful : in Filedtrip

```
ft_prepare_leadfield will calculate the sourcemodel if you did not provide one , this is why
some times you see in totutial , you do not see any sourcemodel input, beause they has done this for you during the
```

ft_prepare_leadfield function, so do not get confused as me trying to approach a sourcemodel with everything I can.