• Stars
    star
    184
  • Rank 209,187 (Top 5 %)
  • Language
    Jupyter Notebook
  • License
    BSD 3-Clause "New...
  • Created over 6 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Previous version of eeg-notebooks

( Note: eeg-notebooks is now at version 0.2, with some major changes to the API and code base. The current up-to-date code base can be found here. The current repo is the the original repo, which has been frozen at version 0.1 and renamed. Why do this, rather than putting the legacy code on a separate branch? Because for version 0.2 we have stripped out a lot of old files (e.g. example data, which is now in a separate location), to get the repo down to a more manageable size (now ~30MB, as opposed to the present repo's 700+MB. So, please go check out the shiny new and improved library, and do get in touch (ideally in the form of an issue in the new repo) if you have any issues or questions! ).

EEG Notebooks

A collection of classic EEG experiments implemented in Python and Jupyter notebooks. This repo is a work in progress with the goal of making it easy to perform classical EEG experiments and automatically analyze data.

Currently, all experiments are implemented for the Muse EEG device and based on work done by Alexandre Barachant and Hubert Banville for the muse-lsl library.

Please see the documentation for advanced installation instructions and complete info about the project.

Getting Started

Installation

If you are a Mac user, follow the installation instructions here

You will need a Muse 2016 and Python installed on your computer. Psychopy, the stimulus presentation library that underlies most of the experiments, officially only supports Python 2. However, some users, especially those on Linux, have been able to work entirely in Python 3 without any issues.

git clone https://github.com/neurotechx/eeg-notebooks

Install all requirements.

pip install -r requirements.txt

See here for more detailed setup instructions for windows operating systems.

Running Experiments

Open the experiment you are interested in running in notebooks folder. Notebooks can be opened either with the Jupyter Notebook browser environment (run jupyter notebook) or in the nteract desktop application.

All experiments should be able to performed entirely within the notebook environment. On Windows 10, you will want to skip the bluetooth connection step and start an EEG data stream through the BlueMuse GUI.

*Note: if errors are encountered during viewing of the eeg data, try starting the viewer directly from the command line (muselsl view). Version 2 of the viewer may work better on Windows computers (muselsl view -v 2)

The basic steps of each experiment are as follows:

  1. Open an LSL stream of EEG data.
  2. Ensure that EEG signal quality is excellent and that there is very little noise. The standard deviation of the signal (displayed next to the raw traces) should ideally be below 10 for all channels of interest.
  3. Define subject and session ID, as well as trial duration. Note: sessions are analyzed independently. Each session can contain multiple trials or 'run-throughs' of the experiments.
  4. Simultaneously run stimulus presentation and recording processes to create a data file with both EEG and event marker data.
  5. Repeat step 4 to collect as many trials as needed (4-6 trials of two minutes each are recommended in order to see the clearest results)
  6. Load experimental data into an MNE Raw object.
  7. Apply a band-pass filter to remove noise
  8. Epoch the data, removing epochs where amplitude of the signal exceeded a given threshold (removes eye blinks)
  9. Generate averaged waveforms from all channels for each type of stimulus presented

Notebooks in the old_notebooks folder only contain the data analysis steps (6-9). They can be used by using the run_experiments.py script (e.g python run_eeg_experiment.py Auditory_P300 15 1)

Currently available experiments:

  • N170 (Faces & Houses)
  • SSVEP
  • Visual P300
  • Cueing (Kyle Mathewson)
  • Baseline (Kyle, Eye's Open vs. Closed, needs notebook made)

More Repositories

1

awesome-bci

Curated Collection of BCI resources
1,042
star
2

moabb

Mother of All BCI Benchmarks
Python
686
star
3

EEG-ExPy

EEG Experiments in Python
Python
443
star
4

eeg-101

Interactive neuroscience tutorial app using Muse and React Native to teach EEG and BCI basics.
JavaScript
244
star
5

bci-workshop

Material for the BCI Workshop held at District 3 in May 2015 by BCI Montréal.
Python
88
star
6

learn.neurotechedu.com

Source code for our open-source EDU website
Jupyter Notebook
71
star
7

dl-eeg-playground

Deep Learning EEG Playground
Jupyter Notebook
65
star
8

neurodoro

🍅 A dynamic brain-responsive pomodoro timer
Jupyter Notebook
52
star
9

neurotechx.github.io

NeuroTechX website
CSS
11
star
10

tutorials

NeuroTechX Tutorials & Learning Material
10
star
11

studentclubs

JavaScript
7
star
12

Brainlock

N400 based EEG biometric authentication system
Jupyter Notebook
6
star
13

node-edf

Resources for reading and writing EEG data into edf, edf+, and bdf files with JS (hopefully a library, eventually)
JavaScript
6
star
14

ntx_slack_archive

Archive of the messages posted on slack
4
star
15

Resource-Kit

Graphics resource kit for everything NTX
3
star
16

NTX-dockit

NeuroTechX Chapter Information!
HTML
3
star
17

Neurocademy

neurocademy 1.0 site
CSS
2
star
18

neureka-challenge

Neureka™ 2020 Epilepsy Challenge - From Tutorials to Winning Solutions
Jupyter Notebook
2
star
19

neurotechedu

HTML
1
star
20

ntx_slack_resources

Middleware used to synchronize neurotechedu and the slack edubot.
1
star
21

gamma-light

Gamma entrainment and amyloid beta reduction with light
JavaScript
1
star
22

ntx-sc

JavaScript
1
star