Git Product home page Git Product logo

niklasbrake / eeg_modelling Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 31.39 MB

Code for simulating aperiodic EEG signals and detrending EEG spectra, as well as generating figures used in manuscript.

License: Creative Commons Attribution 4.0 International

MATLAB 83.23% Shell 3.59% Python 7.98% C 2.54% AMPL 2.25% M 0.41%
figure-generation neural-networks numerical-simulations publication-code spectral-analysis computational-neuroscience ecog electrophysiology lfp eeg

eeg_modelling's Introduction

DOI

Paper

This code repository is associated with the following publication:

Brake, N., Duc, F., Rokos, A. et al. A neurophysiological basis for aperiodic EEG and the background spectral trend. Nat Commun 15, 1514 (2024). https://doi.org/10.1038/s41467-024-45922-8

Executing code in this repository

To reproduce the figures, data needs to be downloaded from https://doi.org/10.6084/m9.figshare.24777990. Once this data is downloaded, line 16 of EEG_modelling/model/network_simulation_beluga.m needs to be updated, such that the variable resourceFolder points to the data folder.

If you wish to simulate dipoles, the script EEG_modelling/simulation_examples/example_embedding.m outlines how the model can be simulated. To run this script, the file EEG_modelling/model/compute_tiling_correlation.c needs to be compiled, which can be accomplished with the following command:

gcc compute_tiling_correlation.c -o compute_tiling_correlation.exe -lm -fopenmp

The python packages in requirements.txt need to be installed, which can be accomplished with the following command:

pip install -r requirements.txt

Finally, the .MOD files need to be compiled for the neuron simulator. To do so, navigate to the folder EEG_modelling/model/mod_files and run the command

mknrndll

Detrending EEG spectra

The file EEG_modelling/data_analysis/detrending.py contains the code used to fit Eq. 1, 5, and 6 from the manuscript to EEG spectra. The upper and lower bounds for the various parameters were optimized for our data and may need to be adjusted. EEG_modelling/data_analysis/synDetrend.m is a wrapper to run this function from MATLAB.

Acknowledgements

I completed this work as part of my PhD under the supervision of Dr. Anmar Khadra and in collaboration with Dr. Gilles Plourde at McGill Univeristy. The EEG data used in this project was collected by Dr. Plourde and his team.

License

Creative Commons License
This repository is licensed under a Creative Commons Attribution 4.0 International License.

eeg_modelling's People

Contributors

niklasbrake avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

bilalghori

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.