Overview
supereeg (name inspired by Robert Sawyer's The Terminal Experiment is a (fictional) tool for recording the electrical activities of every neuron in the living human brain. Our approach is somewhat less ambitious, but (we think) still "super" cool: obtain high spatiotemporal estimates of activity patterns throughout the brain using data from a small(ish) number of implanted electrodes. The toolbox is designed to analyze ECoG (electrocorticographic) data, e.g. from epilepsy patients undergoing pre-surgical evaluation.
The way the technique works is to leverage data from different patients' brains (who had electrodes implanted in different locations) to learn a "correlation model" that describes how activity patterns at different locations throughout the brain relate. Given this model, along with data from a sparse set of locations, we use Gaussian process regression to "fill in" what the patients' brains were "most probably" doing when those recordings were taken. Details on our approach may be found in this preprint. You may also be interested in watching this talk or reading this blog post from a recent conference.
Although our toolbox is designed with ECoG data in mind, in theory this tool could be applied to a very general set of applications. The general problem we solve is: given known (correlational) structure of a large number of "features," and given that (at any one time) you only observe some of those features, how much can you infer about what the remaining features are doing?
Toolbox documentation, including a full API specification, tutorials, and gallery of examples may be found here on our readthedocs page.
Installation
You may install the latest stable version of our toolbox using [pip]( Recommended way of installing the toolboxhttps://pypi.python.org/pypi/pip):
pip install supereeg
or if you have a previous version already installed:
pip install --upgrade supereeg
To install the latest (bleeding edge) version directly from this repository use: Dangerous/hacker/developer way of installing the toolbox (use caution!)
pip install --upgrade git+https://github.com/ContextLab/supereeg.git
Requirements
The toolbox is currently supported on Mac and Linux. It has not been tested on Windows (and we expect key functionality not to work properly on Windows systems).
Dependencies:
- python 2.7, 3.5+
- pandas>=0.21.1
- seaborn>=0.7.1
- matplotlib==2.1.0
- scipy>=0.17.1
- numpy>=1.10.4
- scikit-learn>=0.18.1
- nilearn
- nibabel
- joblib
- multiprocessing
- deepdish
- future
- imageio
- hypertools
- scikit-image
- pytest (for development)
Citing
We wrote a paper about supereeg, which you can read here. The paper provides full details about the approach along with some performance tests an a large ECoG dataset. If you use this toolbox or wish to cite us, please use the following citation:
Owen LLW and Manning JR (2017) Towards Human Super EEG. bioRxiv: 121020
Here is a bibtex formatted reference:
@article {Owen121020,
author = {Owen, Lucy L. W. and Manning, Jeremy R.},
title = {Towards Human Super EEG},
year = {2017},
doi = {10.1101/121020},
publisher = {Cold Spring Harbor Labs Journals}
URL = {http://biorxiv.org/content/early/2017/03/27/121020},
eprint = {http://biorxiv.org/content/early/2017/03/27/121020.full.pdf},
journal = {bioRxiv}
}
Contributing
Thanks for considering adding to our toolbox! Some text below hoas been borrowed from the Matplotlib contributing guide.
Submitting a bug report
If you are reporting a bug, please do your best to include the following:
- A short, top-level summary of the bug. In most cases, this should be 1-2 sentences.
- A short, self-contained code snippet to reproduce the bug, ideally allowing a simple copy and paste to reproduce. Please do your best to reduce the code snippet to the minimum required.
- The actual outcome of the code snippet
- The expected outcome of the code snippet
Contributing code
The preferred way to contribute to supereeg is to fork the main repository on GitHub, then submit a pull request.
-
If your pull request addresses an issue, please use the title to describe the issue and mention the issue number in the pull request description to ensure a link is created to the original issue.
-
All public methods should be documented in the README.
-
Each high-level plotting function should have a simple example in the examples folder. This should be as simple as possible to demonstrate the method.
-
Changes (both new features and bugfixes) should be tested using
pytest
. Add tests for your new feature to thetests/
repo folder. -
Please note that the code is currently in beta thus the API may change at any time. BE WARNED.
Testing
To test supereeg, install pytest (pip install pytest
) and run pytest
in the supereeg folder