Skip to content
Template for a group study using the MNE Python software
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
tests config_matchingpennies -> config_eeg_matchingpennies Aug 25, 2019
.gitignore
01-import_and_filter.py wrap in main() Aug 25, 2019
02-apply_maxwell_filter.py put logic from main into main func Aug 25, 2019
03-extract_events.py
04-make_epochs.py wrap in main() Aug 25, 2019
05a-run_ica.py put logic from main into main func Aug 25, 2019
05b-run_ssp.py put logic from main into main func Aug 25, 2019
06a-apply_ica.py put logic from main into main func Aug 25, 2019
06b-apply_ssp.py put logic from main into main func Aug 25, 2019
07-make_evoked.py
08-group_average_sensors.py
09-sliding_estimator.py
10-time_frequency.py wrap in main() Aug 25, 2019
11-make_forward.py
12-make_cov.py
13-make_inverse.py
14-group_average_source.py
99-make_reports.py wrap in main() Aug 25, 2019
CONTRIBUTING.md DOC: improve contrib Aug 25, 2019
Makefile
README.md fix links Aug 20, 2019
config.py config_matchingpennies -> config_eeg_matchingpennies Aug 25, 2019

README.md

CircleCI

MNE-study-template

This repository contains an exemplary pipeline for processing MEG/EEG data using MNE-Python and the Brain Imaging Data Structure (BIDS).

The study template expects input data to adhere to BIDS. You can check whether your data complies with the BIDS standard using the BIDS validator.

Installation

First, you need to make sure you have MNE-Python installed and working on your system. See the installation instructions. Once this is done, you should be able to run this in a terminal:

$ python -c "import mne; mne.sys_info()"

You can then install the following additional packages via pip. Note that the URL points to the bleeding edge version of mne_bids:

$ pip install https://github.com/mne-tools/mne-bids/zipball/master

Usage

General

Generally, there is a single config.py file, which contains all parameters for the analysis of the data. Many parameters are automatically inferred from the BIDS structure of the data.

All other scripts should not be edited.

Makefile

To ease interaction with the study template, there is a Makefile. Simply type make from the root of your study template to see a summary of what you can do, or inspect the file directly.

For Windows users, it might be necessary to install GNU make.

Running on your own data

  1. Make sure your data is formatted in BIDS
  2. Set an environment variable BIDS_ROOT to point to your dataset
  3. (optional) Set an environment variable MNE_BIDS_STUDY_CONFIG to point to a custom config_<dataset_name>.py file that you created to overwrite the standard parameters in the main config.py file.
  4. Use the Makefile to run your analyses

Processing steps

The following table provides a concise summary of each step in the pipeline.

Script Description
config.py The only file you need to modify in principle. This file contain all your parameters.
01-import_and_filter.py Read raw data and apply lowpass or/and highpass filtering.
02-apply_maxwell_filter.py Run maxfilter and do lowpass filter at 40 Hz.
03-extract_events.py Extract events or annotations or markers from the data and save it to disk. Uses events from stimulus channel STI101.
04-make_epochs.py Extract epochs.
05a-run_ica.py Run Independant Component Analysis (ICA) for artifact correction.
05b-run_ssp.py Run Signal Subspace Projections (SSP) for artifact correction. These are often also referred to as PCA vectors.
06a-apply_ica.py As an alternative to ICA, you can use SSP projections to correct for eye blink and heart artifacts. Use either 5a/6a, or 5b/6b.
06b-apply_ssp.py Apply SSP projections and obtain the cleaned epochs.
07-make_evoked.py Extract evoked data for each condition.
08-group_average_sensors.py Make a group average of the time domain data.
09-sliding_estimator.py Running a time-by-time decoder with sliding window.
10-time_frequency.py Running a time-frequency analysis.
11-make_forward.py Compute forward operators. You will need to have computed the coregistration to obtain the -trans.fif files for each subject.
12-make_cov.py Compute noise covariances for each subject.
13-make_inverse.py Compute inverse problem to obtain source estimates.
14-group_average_source.py Compute source estimates average over subjects.
99-make_reports.py Compute HTML reports for each subject.

Acknowledgments

The original pipeline for MEG/EEG data processing with MNE python was build jointly by the Cognition and Brain Dynamics Team and the MNE Python Team, based on scripts originally developed for this publication:

M. Jas, E. Larson, D. A. Engemann, J. Leppäkangas, S. Taulu, M. Hämäläinen, A. Gramfort (2018). A reproducible MEG/EEG group study with the MNE software: recommendations, quality assessments, and good practices. Frontiers in neuroscience, 12. https://doi.org/10.3389/fnins.2018.00530

The current iteration is based on BIDS and relies on the extensions to BIDS for EEG and MEG. See the following two references:

Pernet, C. R., Appelhoff, S., Gorgolewski, K. J., Flandin, G., Phillips, C., Delorme, A., Oostenveld, R. (2019). EEG-BIDS, an extension to the brain imaging data structure for electroencephalography. Scientific Data, 6, 103. https://doi.org/10.1038/s41597-019-0104-8

Niso, G., Gorgolewski, K. J., Bock, E., Brooks, T. L., Flandin, G., Gramfort, A., Henson, R. N., Jas, M., Litvak, V., Moreau, J., Oostenveld, R., Schoffelen, J., Tadel, F., Wexler, J., Baillet, S. (2018). MEG-BIDS, the brain imaging data structure extended to magnetoencephalography. Scientific Data, 5, 180110. https://doi.org/10.1038/sdata.2018.110

You can’t perform that action at this time.