In this tutorial you can find information about how to construct a source model that can be used for source reconstruction of EEG or MEG data. The source model describes a set of positions (and possibly orientations) of equivalent current dipoles that are taken into consideration when doing the source reconstruction. Note that not all source reconstruction methods require an explicit definition of a source model. Note also, that by and large source models should have the same specifications, irrespective of whether you are reconstructing EEG or MEG data. In this tutorial we will show how to use subject-specific anatomical data to create different types of source models. Which source model is most appropriate depends on the source reconstruction algorithm used, the additional analysis steps you have in mind, and on your own preferences. The anatomical MRI data is available from the ftp server.
This tutorial will not show how to perform the source reconstruction itself. If you are interested in source reconstruction methods, you can go to the Localizing oscillatory sources using beamformer techniques and to the Source reconstruction of event-related fields using minimum-norm estimate tutorials.
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).
We will describe a few different ways to create a source model based on the anatomical mri of the tutorial data set which is available here. Some of these procedures can be done entirely using high-level FieldTrip functions. Other procedures require the use of external software, in particular Freesurfer, or HCP-workbench.
Figure 2. Pipeline of creating a sourcemodel
Content is coming soon!
Content is coming soon! For now, you can have a look at the source model section of the minimumnormestimate tutorial.
When you are doing a group study, where you want to combine the source-reconstructed data across multiple subjects, you can do in several ways:
We recommend the second strategy, but for completeness we also describe the first strategy.
Content is coming soon!
The idea is to use a template grid that is defined in normalized space, e.g. based on a template anatomical MRI in MNI coordinates. Subsequently, each individual MRI is warped to this template MRI, and the inverse of this warp is applied to the template dipole grid. Hereby the individual subjects' grids are not regularly spaced anymore (meaning the distance between 2 grid points can vary), see figure 1. However, as a consequence of this warping procedure, homologous grid points across subjects are located at exactly the same location in normalized MNI space. As a consequence, the source-reconstructed activity can be directly averaged across subjects. You can either define a template grid yourself, or use one from a set of predefined template grids that are included in fieldtrip: fieldtrip/template/sourcemodel/standard_gridXmm.mat.
fig 1a: Example: the MNI template brain and the brains of 3 subjects
fig 1b: Example: the MNI grid and the grid of 3 subjects, note that each grid point points to the same location in all brains, and that the subjects' grids are not regularly spaced
In the figures above, the spatial deformation of the individual subjects' brains relative to the template brain is exemplified. However, there may be other relevant differences between the coordinate system used for the individual subjects' anatomy and the MNI coordinate system. For example, in MEG-datasets it is custom to use a coordinate system that is defined relative to the three coils that are placed on the nose and the ears, with a specific orientation of the coordinate axes, whereas the MNI/SPM coordinate system is defined in a different way.
First, you need to define a template grid, as mentioned above, and the easiest thing to do so is to load in a pre-existing template grid, as shown in the next section. Alternatively, you can create one yourself, which is explained next.
% NOTE: the path to the template file is user-specific ftpath = '/home/common/matlab/fieldtrip'; % this is the path to fieldtrip at Donders template = ft_read_mri(fullfile(ftpath, '/external/spm8/templates/T1.nii')); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): % this is needed to describe the boundary that define which dipole locations are 'inside' the brain. cfg = ; template_seg = ft_volumesegment(cfg, template); cfg = ; cfg.method = 'singleshell'; template_headmodel = ft_prepare_headmodel(cfg, template_seg); template_headmodel = ft_convert_units(template_headmodel, 'cm'); % Convert the vol to cm, because the CTF convenction is to express everything in cm. % construct the dipole grid in the template brain coordinates % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = ; cfg.grid.resolution = 1; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.headmodel = template_headmodel; template_grid = ft_prepare_sourcemodel(cfg); % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_headmodel, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:));
fig 2: template grid and headmodel, top view
% read the single subject anatomical MRI mri = ft_read_mri('Subject01.mri'); % segment the anatomical MRI cfg = ; cfg.output = 'brain'; seg = ft_volumesegment(cfg, mri); % construct the volume conductor model (i.e. head model) for each subject % this is optional, and for the purpose of this tutorial only required for % plotting, later on cfg = ; cfg.method = 'singleshell'; headmodel = ft_prepare_headmodel(cfg, seg); % create the subject specific grid, using the template grid that has just been created cfg = ; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri; cfg.grid.unit ='mm'; grid = ft_prepare_sourcemodel(cfg); % make a figure of the single subject headmodel, and grid positions figure; hold on; ft_plot_vol(headmodel, 'edgecolor', 'none', 'facealpha', 0.4); ft_plot_mesh(grid.pos(grid.inside,:));
fig 3: template grid in single-subject head coordinates, superimposed onto the headmodel
Content is coming soon!
In this tutorial, it was explained how to build a sourcemodel that can be used for source-reconstruction of measured EEG or MEG activity.
You can read more about specific source-reconstruction methods in the Localizing oscillatory sources using beamformer techniques and in the Source reconstruction of event-related fields using minimum-norm estimate tutorials.
Here are the related faqs:
and the related example scripts: