Brainstorm
  • Comments
  • Menu
    • Attachments
    • Versions
    • Raw Text
    • Print View
  • Login

Software

  • Introduction

  • Gallery

  • Download

  • Installation

Users

  • Tutorials

  • Forum

  • Courses

  • Community

  • Publications

Development

  • What's new

  • What's next

  • About us

  • Contact us

  • Contribute

Revision 126 as of 2018-08-13 11:16:45
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

MEG visual tutorial: Group analysis (BIDS)

Authors: Francois Tadel, Elizabeth Bock.

The aim of this tutorial is to reproduce in the Brainstorm environment the analysis described in the SPM tutorial "Multimodal, Multisubject data fusion". It is part of a collective effort to document and standardize MEG/EEG group analysis, see Frontier's research topic: From raw MEG/EEG to publication: how to perform MEG/EEG group analysis with free academic software.

The data processed here consists in simultaneous MEG/EEG recordings of 16 subjects performing a simple visual task on a large number of famous, unfamiliar and scrambled faces. This tutorial follows another page that explains how to process one single subject in details.

Contents

  1. License
  2. Download and installation
  3. Overview of the analysis
    1. Coregistration of the acquisition runs
    2. Objectives
  4. Subject averages: Famous, Unfamiliar, Scrambled
    1. MEG/EEG
    2. Sources
    3. Time-frequency
  5. Subject averages: Faces
    1. MEG/EEG
    2. Sources
    3. Time-frequency
  6. Subject averages: Within-subject differences
    1. Sources: Faces - Scrambled
    2. Sources: Famous - Unfamiliar
  7. Subject averages: Filter and normalize
    1. MEG/EEG
    2. Sources
    3. Time-frequency
  8. Subject averages: Screen captures
  9. Group analysis: MEG/EEG
    1. Grand averages
    2. Faces - Scrambled: Differences of averages
    3. Faces - Scrambled: Significance testing
    4. Famous - Unfamiliar: Differences of averages
    5. Famous - Unfamiliar: Significance testing
  10. Group analysis: Sources
    1. Project sources on template
    2. Spatial smoothing
    3. MEG: mean(|Faces-Scrambled|)
    4. MEG: Chi2-test |Faces-Scrambled|=0
    5. MEG: Chi2-test log(|Faces-Scrambled|)=0
    6. MEG: mean(|Faces|)-mean(|Scrambled|)
    7. MEG: Student t-test |Faces|=|Scrambled|
    8. EEG: Faces-Scrambled
  11. Scripting

License

This dataset was obtained from the OpenNeuro project (https://openneuro.org/), accession #ds117. It is made available under the Creative Commons Attribution 4.0 International Public License. Please cite the following reference if you use these data:
Wakeman DG, Henson RN, A multi-subject, multi-modal human neuroimaging dataset, Scientific Data (2015)

Any questions, please contact: rik.henson@mrc-cbu.cam.ac.uk

Download and installation

First, make sure you have enough space on your hard drive, at least 40Gb:

  • The Brainstorm database with all the data imported, downloaded from this website: 20Gb

  • The same database after this tutorial: 40Gb

You can follow this tutorial after processing the recordings for the 16 good subjects (6 runs per subject) as illustrated in the single subject tutorial. Otherwise, we provide a Brainstorm protocol that includes all the imported data, downsampled at 275Hz:

  • Go to the Download page, download the file TutorialGroup.zip (20Gb).

  • Unzip this file in your Brainstorm database folder (brainstorm_db).
  • In Brainstorm, menu File > Load protocol > Load from folder > Select brainstorm_db/TutorialGroup

The database you need in order to follow this tutorial should contain the following:

  • The individual anatomy imported from FreeSurfer for each subject (16 subjects).

  • The sensor level averages (MEG+EEG) for each run (downsampled to 275Hz or not).
  • The forward model, noise covariance and inverse models for each subject and each run.

    db_tutorialgroup.gif

  • This protocol TutorialGroup is produced from the single subject protocol TutorialVisual with the script: brainstorm3/toolbox/script/tutorial_visual_full_copy.m

    Could not open file.

Overview of the analysis

Coregistration of the acquisition runs

For each subject, all the runs have been registered to a common head position with MaxFilter. To verify this, select all the channel files within one subject, right-click > Display sensors > MEG (all). The surfaces representing the MEG helmet are perfectly overlapping for all the runs. When the runs are not aligned, it looks like this.

  • run_coreg.gif

This means we can safely average or compare the MEG sensor values across runs within one subject. However, it is not reliable to average MEG recordings across subjects, because of the anatomical differences between subjects.

This doesn't mean we can estimate the sources only once per subject. We have computed different SSP projectors and selected different bad channels for each acquisition run. To be able to use this information efficiently we should estimate the sources for each run separately, then average the sources across runs.

The forward model is the same for all the runs within one subject, therefore it can be computed for the first run and copied to all the other runs.

Objectives

The objectives for this tutorial are to reproduce the analysis presented in the following documents:

  • Wakeman DG, Henson RN, A multi-subject, multi-modal human neuroimaging dataset
    Scientific Data (2015)

  • Wakeman DG, Henson RN, Functional and structural connrctivity in face processing: MEG, EEG, fMRI, MRI and DWI data, Biomag 2016

  • SPM12 manual, chapter 41: Multimodal, Multisubject data fusion

Summary of the results we will compute in this tutorial:

  • Subject and grand averages for each condition (Famous, Unfamiliar, Scrambled).
  • Normalization of these averages (Z-score for the sources, or ERS/D for the time-frequency maps).
  • Projection of the sources results on a template and spatial smoothing of the source maps.
  • Contrast between faces (famous+unfamiliar) and non-faces (scrambled): difference of averages and significance test.
  • Contrast between famous faces and unfamiliar faces: difference of averages and significance test.
  • Sensors of interest: EEG070 (or EEG060 or EEG065 if EEG070 is marked as bad)

Expected effects:

  • OFA: Bilateral occipital face area
  • FFA: Bilateral fusiform face area
  • STS: Right superior temporal sulcus
  • Around 170ms (N170): Difference between Faces and Scrambled.
  • After 250ms: Difference between Famous and Unfamiliar.

The methodology that we will follow for computing the averages and the other statistics is described in the tutorial "Workflows".

Subject averages: Famous, Unfamiliar, Scrambled

We will start by computing the subject-level averages for all the data types we have: sensor-level recordings, source maps and time-frequency results. We will use a weighted average to group the results we have for each run (weighted by the number of good trials). We want to compute the averages for each experimental condition separately (famous, unfamiliar, scrambled).

Since the files are already selected in the interface, we will also compute a grand average across subject. In this context, we will consider that each subject has the same weight in the grand average (option "weighted" not selected). Note that it is not accurate to average MEG recordings across subjects, but we can do it just to get a general idea of the group effects (more information).

MEG/EEG

  • Drag and drop all the subjects in Process1. Select button [Process recordings].

  • Select process Average > Average files: By trial group (subject average)
    Arithmetic average, Weighted

  • Add process Average > Average files: By trial group (grand average)
    Arithmetic average, Not weighted

    average_process_data.gif

  • In output, you get three grand averages in the "Group analysis/Inter-subject" folder (top), and three subject averages per subject in the "intra-subject" folders (bottom). average_files_data.gif

Sources

  • Keep all the subjects selected in Process1. Select button [Process sources].

  • If you run the averaging process directly with this file selection, it would average together the MEG and the EEG sources (36 files selected per subject instead of 18). To average separately the two modalities, we can use the Filter box at the bottom-right corner of the Brainstorm window. Enter "EEG" and it would select only the files with a comment including the tag "EEG".

  • Select process Average > Average files: By trial group (subject average)
    EEG source files only, Arithmetic average, Weighted

  • Add process File > Add tag: EEG.

    average_process_sources.gif

  • Repeat the same steps with the MEG source files (select all subjects, filter, average, tag).

  • This time, we cannot compute a grand average directly because the source spaces used to estimate the brain activity do not match between subjects. We have to go through an additional step of projection on a template anatomy. We will also wait to have normalized the source maps before displaying them.

    average_files_sources.gif

Time-frequency

  • Keep all the subjects selected in Process1. Select button [Process time-freq].
    Make sure you reset the Filter search box at the bottom-right of the Brainstorm window.

  • Run process Average > Average files: By trial group (subject average)
    Arithmetic average, Weighted, Match signals

    average_process_tf.gif

  • Like for the sources, we will first normalize the time-frequency maps with respect with a baseline before computing grand averages. Like the sensor data: it is valid to average EEG recordings across subjects, but it is not accurate to average MEG sensors across subjects.
  • We can average the time-frequency files across runs (it is as valid as averaging the MEG or EEG signals), but we need to select this option "match signals between files using their names" to account for the variable number of bad channels we may have across runs or subjects.

    average_files_tf.gif

Subject averages: Faces

One of the contrast we want to study is faces (Famous and Unfamiliar) vs non-faces (Scrambled). We need to re-average the Famous and Unfamiliar averages together.

MEG/EEG

  • In Process2: FilesA = all the Famous subject averages, FilesB = all the Unfamiliar subject averages. The subjects must be in the same order in the two lists because the process will process the files by pairs of files (A,B).
  • Select process Other > Average A&B: Weighted.
    Add process File > Set comment: Comment = "WAvg: Avg: Faces"
    Add process Average > Average files: By trial group (subject average): Not weighted

    average_faces_data.gif

  • Selecting that many files from the database explorer can be long when done manually, but can be very efficient from a script. Check out the script equivalent at the end of this page.
  • It creates one new average for each pair (A,B) and computes the grand average for condition Faces.

    average_faces_data2.gif

Sources

  • In Process2: FilesA = all the Famous subject averages (EEG only) [Process sources]

  • In Process2: FilesB = all the Unfamiliar subject averages (EEG only) [Process sources]

  • Make sure the order of the files matches in the two lists.
  • Select process Other > Average A&B: Weighted.
    Add process File > Set comment: Comment = "WAvg: Avg: Faces | EEG"

    average_faces_sources.gif

  • Repeat the same steps for the MEG sources.

    average_faces_sources2.gif

Time-frequency

  • In Process2: FilesA = all the Famous subject averages (EEG only) [Process timefreq]

  • In Process2: FilesB = all the Unfamiliar subject averages (EEG only) [Process timefreq]

  • Select process Other > Average A&B: Weighted.
    Add process File > Set comment: Comment = "WAvg: Avg: Faces"

    average_faces_timefreq.gif

  • In output: the average for the Face condition, for each subject.

    average_faces_timefreq2.gif

Subject averages: Within-subject differences

To detect correctly the differences between two conditions at the source level, we need to estimate the differences of the conditions for each subject, and then normalize the difference (see tutorial Workflows).

Sources: Faces - Scrambled

  • In Process2: FilesA = all the Faces subject averages (EEG only) [Process sources]

  • In Process2: FilesB = all the Scrambled subject averages (EEG only) [Process sources]

  • Select process Difference > Difference A-B: Do not use absolute values.

  • Add process File > Set comment: Comment=Faces - Scrambled | EEG

    diffsubj_faces.gif

  • Repeat the same steps for the MEG sources.

Sources: Famous - Unfamiliar

  • In Process2: FilesA = all the Famous subject averages (EEG only) [Process sources]

  • In Process2: FilesB = all the Unfamiliar subject averages (EEG only) [Process sources]

  • Select process Difference > Difference A-B: Do not use absolute values.

  • Add process File > Set comment: Comment=Famous - Unfamiliar | EEG

  • Repeat the same steps for the MEG sources.

    diffsubj_files.gif

Subject averages: Filter and normalize

Before comparing the averages across subjects we are going to low-pass filter the signals below 32Hz (to smooth possible latency differences between subjects) and normalize the source and time-frequency values with respect with a baseline (see tutorial Workflows).

MEG/EEG

  • In Process1, select all the Intra-subject folders from all the subjects, select [Process recordings]. For a faster selection, you can use the view "Functional data (sorted by conditions)".

  • Select process Pre-process > Band-pass filter: 0Hz-32Hz, MEG,EEG, 60dB, No mirror, Overwrite.

  • Add process Extract > Extract time: Time window=[-200,900]ms

    filter_data_process.gif

  • Two tags are added at the end of the comments of the averaged recordings. The selection of a smaller time window gets rid of most of the possible edge effects caused by the filter.

    filter_data_files.gif

Sources

  • In Process1, select all the Intra-subject folders from all the subjects, select [Process sources].

  • Select process Pre-process > Band-pass filter: 0Hz-32Hz, MEG,EEG, Mirror, Overwrite

  • Add process Extract > Extract time: Time window=[-200,900]ms

  • Add process Standardize > Baseline normalization: Baseline=[-200,-5]ms, Z-score, Overwrite

    filter_sources_process.gif

  • Three tags are added at the end of the comments of the averaged sources.

    filter_sources_files.gif

Time-frequency

  • In Process1, select all the Intra-subject folders from all the subjects, select [Process time-freq].

  • Run process Standardize > Baseline normalization: Baseline=[-200,-5]ms, ERS/ERD, Overwrite

    filter_tf_process.gif

  • One tag is added at the end of the comments of the averaged time-frequency maps.

    filter_tf_files.gif

Subject averages: Screen captures

Now we have all the measures ready to be compared across subjects: MEG/EEG, sources, time-frequency. Let's take a few screen captures to make sure the primary visual response look good for all the subjects. The screen captures below represent from left to right:

  • Registration sensors/MRI: Head surface, MEG (inside of the helmet), EEG+headpoints (green points).
  • Faces: EEG recordings
  • Faces: MEG sources at 107ms
  • Faces: Time-frequency for EEG070

sub002
sub002.gif

sub003
sub003.gif

sub004
sub004.gif

sub006
sub006.gif

sub007
sub007.gif

sub008
sub008.gif

sub009
sub009.gif

sub010
sub010.gif

sub011
sub011.gif

sub012
sub012.gif

sub013
sub013.gif

sub014
sub014.gif

sub015
sub015.gif

sub017
sub017.gif

sub018
sub018.gif

sub019
sub019.gif

Group analysis: MEG/EEG

Grand averages

We have already computed the group averages for all the conditions. We will not look much further at these results as we are more interested in the contrasts between conditions. Below are screen captures for all group averages (top=MEG MAG, bottom=EEG). Topography at [50,100,150,200,250,300]ms.

Faces: Famous / Unfamiliar

gavg_data_famous.gif gavg_data_unfamiliar.gif

Scrambled
gavg_data_scrambled.gif

Faces - Scrambled: Differences of averages

We could compute the contrasts directly from the grand averages, but we will do it from the subject averages because it will be the same file selection for the statistics.

  • In Process2: FilesA = all the Faces subject averages (from the Intra-subject folders).
  • In Process2: FilesB = all the Scrambled subject averages (from the Intra-subject folders).
  • Run process: Test > Difference of means: Arithmetic average, Not weighted.

    stat_data_diffmean.gif

  • Rename the file: Faces - Scrambled (top=MEG MAG, bottom=EEG).

    diff_data_faces.gif

Faces - Scrambled: Significance testing

We have computed the amplitude of the difference between the two conditions, and we will try now to estimate a p-value indicating the significance of each of these values. In all the screen captures below: top=MEG MAG, bottom=EEG.

  • In Process2: Keep the same file selection.
  • Run process: Test > Parametric test: Paired: All file, All sensors, No average, two-tailed.

    stat_data_param.gif

  • Rename the file: Faces - Scrambled: Parametric t-test. Display with p<0.05, FDR-corrected.

    ttest_data_faces.gif

  • You can run other tests in a similar way, with almost identical results.
  • Process: Test > Permutation test: Paired: All file, All sensors, Paired t-test, 1000 randomizations. Display with p<0.05, FDR-corrected.

    ttestperm_data_faces.gif

  • Process: Test > FieldTrip: ft_timelockstatistics: All file, EEG, Paired t-test, 1000 randomizations, correction=cluster, cluster alpha=0.05. The cluster-based statistics must be executed on one type of sensors at a time (EEG, MEG MAG or MEG GRAD), because it tries to identify spatio-temporal clusters which groups adjacent sensors.

    cluster_data_faces.gif

Famous - Unfamiliar: Differences of averages

  • In Process2: FilesA = all the Famous subject averages (from the Intra-subject folders).
  • In Process2: FilesB = all the Unfamiliar subject averages (from the Intra-subject folders).
  • Run process: Test > Difference of means: Arithmetic average, Not weighted.

  • Rename the file: Famous - Unfamiliar.

    diff_data_famous.gif

Famous - Unfamiliar: Significance testing

  • In Process2: Keep the same file selection.
  • Run process: Test > Parametric test: Paired: All file, All sensors, No average, two-tailed.

  • Rename the file: Faces - Scrambled: Parametric t-test. Display with p<0.05, FDR-corrected.

    ttest_data_famous.gif

  • Run process: Test > FieldTrip: ft_timelockstatistics: All file, EEG, Paired t-test, 1000 randomizations, correction=cluster, cluster alpha=0.05.

    cluster_data_famous.gif

Group analysis: Sources

Project sources on template

The sources were estimated on the individual anatomy of each subject, the resulting cortical source maps cannot be averaged directly. We need first to re-interpolate all the individual results on a common template (the ICBM152 brain, available in the "default anatomy" folder of the protocol). We also need to extract the absolute values for these source maps: the sign of the minimum norm maps are relative to the orientation of the current with respect to the surface normal, which can vary between subjects.

  • In Process1, select all the Intra-subject folders from all the subjects, select [Process sources]. For a faster selection, you can use the view "Functional data (sorted by conditions)".

  • Select process Pre-process > Absolute values: Sensor types=MEG,EEG, Overwrite.

  • Add process Sources > Project on default anatomy.

    project_sources.gif

  • All the 192 subject averages are projected in the same folder "Group analysis / Intra-subject". Re-organize all the projected source files in new folders, one folder per condition.
  • To create a folder, right-click on Group analysis > New folder. To move a file to the new folder: drag and drop it in the database explorer or use the keyboard shortcuts Ctrl+X/Ctrl+V.

    project_sources2.gif

Spatial smoothing

The source maps estimated with constrained orientations can show very focal activity: two adjacent vertices may have very different normals, and therefore very different current values. When averaging multiple subjects, the peaks of activity may not align very well across subjects. Smoothing spatially the source maps may help obtaining better group results.

  • In Process1, select all the source maps in Group analysis.
  • Run process Sources > Spatial smoothing:

    sources_smooth.gif

MEG: mean(|Faces-Scrambled|)

  • In Process1, select all the source files in Group_analysis/Faces-Scrambled_MEG.
  • Run process Average > Average files: By folder (grand average), Not weighted.
    Display with an arbitrary threshold: Z-score>3.

    sources_absdiff_meg.gif sources_absdiff_meg_right.gif

  • Regions of interest: OFA (Occipital Face Area), FFA (Fusiform Face Area), V1.

    scouts_anat.gif scouts_time_absdiff.gif

  • This approach identifies correctly the effect size at the subject level. But because the sign is ambiguous across subjects, we need to average the absolute values of the differences. Therefore we are able to identify when and where the two conditions are different, but not which condition leads to a stronger brain response.

MEG: Chi2-test |Faces-Scrambled|=0

  • In Process1, select all the source files in Group_analysis/Faces-Scrambled_MEG.
  • Run process Test > Parametric test against zero: All file, One-sample Chi2-test two-tailed.

  • Screen capture: p<0.05 FDR-corrected

    sources_chi2_meg.gif sources_chi2_meg_right.gif

  • This tests the hypotesis H0:[mean_subject(|Faces-Scrambled|) = 0]
    This test is appropriate to detect the differences between the two conditions, but cannot determine which condition is stronger. Its obvious limitation is that it is too sensitive: post-stimulation, everything is shown as significant.

MEG: Chi2-test log(|Faces-Scrambled|)=0

  • Right-click on the folder Group_analysis/Faces-Scrambled_MEG > File > Duplicate folder.

    duplicate_folder.gif

  • Rename the new folder: Faces-Scrambled_MEG_log.

  • In Process1, select all the source files in Group_analysis/Faces-Scrambled_MEG_log.
  • Select process Pre-process > Run Matlab command > "Data = log(Data)";
    Add process Test > Parametric test against zero: All file, One-sample Chi2-test two-tailed.

    log_process.gif

  • Screen capture: p<0.05, FDR-corrected

    sources_chi2log_meg.gif sources_chi2log_meg_right.gif

MEG: mean(|Faces|)-mean(|Scrambled|)

  • In Process2: FilesA = all the source files in Group_analysis/Faces_MEG.
  • In Process2: FilesB = all the source files in Group_analysis/Scrambled_MEG.
  • Run process Test > Difference of means: Arithmetic average, Not weighted.
    Display with an arbitrary threshold: Z-score>3

    sources_diffmean_meg.gif sources_diffmean_meg_right.gif

  • Regions of interest: OFA (Occipital Face Area), FFA (Fusiform Face Area), V1.

    scouts_anat.gif scouts_time.gif

  • This approach is not able to detect correctly all the differences between the two conditions. At the subject level,we discarded the sign of each condition, therefore we are not able to detect differences in the orientation of the sources or phase delays between conditions.

MEG: Student t-test |Faces|=|Scrambled|

  • In Process2: FilesA = all the source files in Group_analysis/Faces_MEG.
  • In Process2: FilesB = all the source files in Group_analysis/Scrambled_MEG.
  • Run process Test > Parametric test: Paired: All file, No average, two-tailed.

  • Screen capture: p<0.05 FDR-corrected

    sources_ttest_meg.gif sources_ttest_meg_right.gif

  • This test the hypothesis H0:[mean(abs(Faces))=mean(abs(Scrambled))].
    This measure is not appropriate to properly identify the differences between the two conditions because it is insensitive to the sign of the sources within each subject.

EEG: Faces-Scrambled

  • Repeat the same operations with the EEG sources.
  • Difference of averages: |Faces-Scrambled| (Z-score>3):
    sources_diffmean_eeg.gif sources_diffmean_eeg_right.gif

  • Parametric Chi2-test: mean_subject(|Faces-Scrambled|) = 0, p<0.05 FDR-corrected
    sources_chi2_eeg.gif sources_chi2_eeg_right.gif

  • Parametric Chi2-test: log(mean_subject(|Faces-Scrambled|)) = 0, p<0.05 FDR-corrected
    sources_chi2log_eeg.gif sources_chi2log_eeg_right.gif

  • Difference of averages: |Faces|-|Scrambled| (Z-score>3)
    sources_ttest_eeg.gif sources_ttest_eeg_right.gif

  • Parametric Student t-test: mean(abs(Faces))=mean(abs(Scrambled)), p<0.05 FDR-corrected
    sources_ttest_eeg.gif sources_ttest_eeg_right.gif

Scripting

The following script from the Brainstorm distribution reproduces the analysis presented in this tutorial page: brainstorm3/toolbox/script/tutorial_visual_full_group.m

Execution reports: Subject averages, MEG/EEG group results, Source group results

Could not open file.





Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):


  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01