Skip to content

Commit 34f1725

Browse files
committed
minor fixes
1 parent 5277215 commit 34f1725

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docs/tutorials/beginners/MEEG/source.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
## Source Reconstruction
1+
# Source Reconstruction
22

33
To estimate the cortical sources that give rise to the EEG and MEG data we will perform source reconstruction (also known as "inverse modelling"). We need to use the structural MRI of the subject to create a "head model" (that defines the cortex, skull and scalp in terms of meshes) and then a "forward model" (that uses a conductor model to simulate the signal at each sensor predicted by a dipolar source at each point in the cortical mesh). This corresponds to an "imaging" or "distributed" solution to the inverse problem.
44

55
You can view the structural MRI of your subject by displaying the NIfTI file `sub-XX-T1w.nii` in the `anat` (T1) sub-directory. This image was manually positioned to roughly match Talairach space, with the origin close to the Anterior Commissure. The approximate position of three fiducials within this MRI space—the nasion, and the left and right pre-auricular points—are stored in the file `mri_fids.txt`. These were identified manually (based on anatomy) and are used to define the MRI coordinates relative to the EEG and MEG coordinates, which need to be coregistered (see below).
66

77
To estimate total power (evoked and induced) of the cortical sources, we need to have the original data for each individual trial. Therefore our input file will be `apMcbefdspmeeg_run_01_sss.mat` (we could select the trial-averaged file if we just wanted to localise evoked effects). Note that one cannot localise power (or phase) data directly.
88

9-
### Create Head Model
9+
## Create Head Model
1010

1111
Select "SPM → M/EEG → Time-frequency → Head model specification". Select the file `apMcbefdspmeeg_run_01_sss.mat` as the "M/EEG datasets", and the inversion index as `1` (this index can track different types of forward models and inverse solutions, for example if you want to compare them). Additional comments relating to each index can be inserted if "comments" is selected.
1212

@@ -20,7 +20,7 @@ As well as the fiducials, a number of head-points across the scalp were digitise
2020

2121
Finally, for the forward model itself, select "EEG head model" and specify this as "EEG BEM"; select "MEG head model" and specify this as "Single Shell". This can then be run. Note that the model parameters are saved, but the gain matrix itself is not estimated until inversion.
2222

23-
### Model Inversion
23+
## Model Inversion
2424

2525
We will compare two approaches to inverting the above forward model (both within a Parametric Empirical Bayesian framework). The first one is called "Multiple Sparse Priors" (MSP), which is a novel approach unique to SPM. This corresponds to a sparse prior on the sources, namely that only a few are active. Go back to the batch editor and select "M/EEG → Source reconstruction → Source Inversion". Use the `Dependency` button to specify the input of the module as the output of the previous module and set the inversion index to `1`.
2626

@@ -30,7 +30,7 @@ The second type of inversion we will examine corresponds to a L2-minimum norm (M
3030

3131
> **Tip** You can slightly speed things up by right-clicking on the `Source Inversion` module in the module list on the left, selecting `Replicate module`, and then just changing the inversion type and index.
3232
33-
### Time-frequency contrasts
33+
## Time-frequency contrasts
3434

3535
Here we are inverting the whole epoch from -100 to +800 ms (and all frequencies), which will produce a time course for every single source. If we want to localise an effect within the cortical mesh, we need to summarise this 4D data by averaging power across a particular time–frequency window. To do this, select "M/EEG → Source reconstruction → Inversion Results". Specify the input as dependent on the output of the source inversion, and set the inversion index to `1`.
3636

@@ -40,27 +40,28 @@ Set the output space as "MNI". Then replicate this module to produce a second "I
4040

4141
Now the source power can be written in one of two ways: (1) as a volumetric NIfTI "Image", or (2) as a surface-based GIfTI "Mesh". The source data are currently represented on the cortical mesh, so writing them to a volumetric image involves interpolation. We will choose the "Image" option so that we can treat the resulting contrast images in the same way that we do MRI images and use 3D Random Field Theory (RFT) for voxel-wise statistics.
4242

43-
### Save batch and review
43+
## Save batch and review
4444

4545
You can now save this inversion batch file (it should look like `batch_localise_job.m`). Once you have run it, you can explore the forward model by pressing the `3D Source Reconstruction` button within the SPM Menu window. This will open a new GUI window, in which you can select "Load" and choose the `apMcbefdspmeeg_run_01_sss.mat` file. On the left-hand side of the "source localisation" window, select the "display" button below the "MRI" button. This will bring up the scalp (orange), inner and outer skull (red) and cortical (blue) meshes of your subject's brain, as shown in the figure below.
4646

4747
![Head model meshes compared with slices from the MRI](./meshes.png)
48-
48+
<br>
4949
*Figure: Head model meshes compared with slices from the MRI. Note that the fiducials are shown by cyan disks.*
5050

5151
The meshes are plotted together with slices from the structural image. The main thing to check here is that the meshes have a sensible shape and are well aligned with the MRI.
5252

5353
You can also try pressing the "display" button beneath the "Co-register" and "Forward Model" buttons to look at the head models and sensor plots. The things to check there are that the EEG and MEG sensors are in sensible positions with respect to the head.
5454

5555
![Forward models for EEG and MEG](./forward.png)
56-
56+
<br>
5757
*Figure: Forward models for EEG (left) and MEG (right).*
5858

5959
Note that the EEG sensors are on the scalp surface, whereas the MEG head model is located more or less in the centre of the MEG sensor array, as expected.
6060

6161
We can also use the same tool to look at the inversion results. The latest inversion index will be shown (2 in this case), which corresponds to the IID inversion. Press the `mip` button below the "Invert" button, and you should see something like the figure below.
6262

6363
![IID inversion results](./iid.png)
64+
<br>
6465
*Figure: IID inversion results.*
6566

6667
The top plot shows the evoked responses for the three conditions from the peak vertex (at +39 -90 -4) at 170 ms, with the red line being the currently selected condition, here "1" for Famous faces (press the "condition" button to toggle through the other conditions).
@@ -83,6 +84,7 @@ This is done by specifying a binary image (i.e., thresholded statistical map) th
8384
You can generate a suitable image by presenting your statistical results using the `Results` button in the SPM Menu window, selecting the relevant `SPM.mat` file from your fMRI analysis, and then thresholding the resulting statistical map in a way that will selectively show the relevant areas (in this case primary visual and fusiform cortex). You can then save this thresholded image as a binary NIfTI file by selecting `save -- all clusters (binary)` in the interactive window as shown below.
8485

8586
![Saving a thresholded image](./priors_saving.png)
87+
<br>
8688
*Figure: Saving a thresholded image.*
8789

8890
The resulting image can then be entered in the `Priors file` field of the `Source Inversion` module in the batch editor.

0 commit comments

Comments
 (0)