Working with MNE-Python and EEG-BIDS
Information
The estimated time to complete this training module is 2.30h.
The prerequisites to take this module are:
- the installation module.
If you have any questions regarding the module content please ask them in the relevant module channel on the school Discord server. If you do not have access to the server and would like to join, please send us an email at school.brainhack [at] gmail [dot] com.
Resources
This module was presented by Davide Momi during the Brainhack Toronto, and the associated notebooks are available here.
The video of the presentation is available below (duration 1h33):
Tutorial
To run the code locally please follow the instructions.
- Download the folder using:
git clone https://github.com/Davi1990/mne_eeg_workshop/
cd folder_path_to_the_cloned_repo
- Install the required dependencies using:
pip install -r requirements.txt
Download the required data folder.
Download the raw file.
Start a new jupyter notebook. For this follow the instructions below: - Open the terminal - Type
jupyter notebook
- If youβre not automatically directed to a webpage, copy the URL printed in the terminal and paste it in your browser - Once on the webpage, navigate to themne_eeg_workshop
you cloned - Open the relevant notebook.
Exercise
- Read through the notebook running all the cells
- Complete the exercises in the notebook
Exercise 1 Check information on the MNE-BIDS file that was saved as part of Tutorial 01 and fill the cells in the notebook with your answers to the questions below.
How many channels do you have for each type of sensor?
What is the sampling frequency?
Have the data been filtered?
What is the frequency of the line noise?
Is there any bad channel?
Exercise 2 Import a new epoched file and generate a figure of both evoked response and principal components.
Read the file `sub-s01_task-faceFO_eeg.fif` as an epoched object.
Make a joint plot of the time-series.
Create a variable with the array of the evoked data.
Decompose the data using SVD (use the function `numpy.linalg.svd`)
Make a `matplotlib` figure with 1 row and 5 columns and plot the first 5 components using the function `mne.viz.plot_topomap`.
- After finishing your exercises, rename the notebook and save it to your local machine.
- Follow up with your local TA(s) to validate you completed the exercises correctly.
- π π π you completed this training module! π π π
More resources
- Other great resources to get started with NME in python: