GithubHelp home page GithubHelp logo

amisepa / brainbeats Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 4.0 1.44 GB

The BrainBeats toolbox, implemented as an EEGLAB plugin, allows joint processing and analysis of EEG and cardiovascular signals (ECG/PPG).

License: GNU General Public License v3.0

MATLAB 100.00%

brainbeats's Introduction

BrainBeats

The BrainBeats toolbox, implemented as an EEGLAB plugin, allows joint processing and analysis of EEG and cardiovascular signals (ECG and PPG) for brain-heart interplay research. Both the general user interface (GUI) and command line are supported (see tutorial). BrainBeats currently supports: 1) Heartbeat-evoked potentials (HEP) and oscillations (HEO); 2) Extraction of EEG and HRV features; 3) Extraction of heart artifacts from EEG signals; 4) brain-heart coherence.

THREE METHODS AVAILABLE

  1. Process EEG data for heartbeat-evoked potentials (HEP) analysis using ECG or PPG signals. Steps include signal processing of EEG and cardiovascular signals, inserting R-peak markers into the EEG data, segmentation around the R-peaks with optimal window length, time-frequency decomposition.

Example of HEP at the subject level, obtained from simultaneous EEG-ECG signals

Example of HEP at the subject level, obtained from simultaneous EEG-PPG signals

  1. Extract EEG and HRV features from continuous data in the time, frequency, and nonlinear domains.
    • HRV time domain: SDNN, RMSSD, pNN50.

    • HRV frequency domain: VLF-power, ULF-power, LF-power, HF-power, LF:HF ratio, Total power.

    • HRV nonlinear domain: Poincare, fuzzy entropy, fractal dimension, PRSA.

    • EEG frequency domain: average band power (delta, theta, alpha, beta, gamma), individual alpha frequency (IAF), alpha asymmetry.

    • EEG nonlinear domain: fuzzy entropy, fractal dimension

Example of power spectral density (PSD) estimated from HRV and EEG data

Example of EEG features extracted from sample dataset

  1. Remove heart components from EEG signals using ICA and ICLabel.

Example of extraction of cardiovascular components from EEG signals

  1. Compute brain-heart coherence (beta version, please test and give feedback)

Example of several brain-heart coherence measures computed with BrainBeats from simultaneous EEG and ECG signals

Scalp topography showing scalp regions coherent with ECG signal for each frequency band

Requirements

Step-by-step tutorial

See our publication for a step-by-step tutorial using the sample dataset: https://www.jove.com/t/65829/brainbeats-as-an-open-source-eeglab-plugin-to-jointly-analyze-eeg

Full-text preprint: https://www.biorxiv.org/content/10.1101/2023.06.01.543272v3.full

Version history

v1.5 (5/2/2024) - METHOD 4 (brain-heart coherence) added

v1.4 (4/1/2024) - publication JoVE (methods 1, 2, 3)

brainbeats's People

Contributors

amisepa avatar arnodelorme avatar

Stargazers

Adla Zubair avatar Yasuo Kabe avatar Athanasios (Thanos) Vourvopoulos avatar Rahul Venugopal v35.0 avatar Felix Schroeder avatar

Watchers

Kostas Georgiou avatar  avatar

brainbeats's Issues

Other missing function

At this point most users have given up. Testing is part of developing, make a second clone to check that it works.

Screen Shot 2023-05-09 at 11 10 51 AM

Infinity reference error

When running the first HEP method on the tutorial dataset using defaults I receive this error:

image

I have the REST1.2 toolbox installed, which did not fix the issue. I could only proceed when switching to average reference.

I use MATLAB r2023a and EEGLAB2023.1

Tutorial Error Method 2 PPG

When running the second method with PPG settings in the tutorial I get this error:

image

Also on MATLAB r2023 and EEGLAB2023.1

Running the tutorial

On the main branch, with the latest changes as of today.
started "brainbeats_tutorial"

This question poped up.

Screenshot 2024-03-08 at 12 27 32 PM

The first time, I answered no and got this error

Screenshot 2024-03-08 at 12 27 47 PM

The second time, I answered yes, and got this error

Screenshot 2024-03-08 at 12 28 07 PM

"EEGLAB error in function get_eeg_features() at line 203:"

Hello and thank you for this - very useful - plugin

I' ve been trying to analyze a number of datasets and have been encountering the same error in each one that I have tested.

I'm using Matlab R2023a, latest version of EEGLAB and latest version of BrainBeats from github.

My datasets have 32 EEG channels + 1 ECG, and a duration of ~500sec, are referenced to average and have channel locations.

I'm using the mode "Extract EEG and HRV features" and the error occurs specifically when extracting EEG frequency domain features.

The following happens for all EEG channels, although not for the same frequency bands.

image

After not being able to detect individualized frequency bounds:

image

and then this error window appears:

image

I will appreciate any help as I have no clue about what could be causing this error or how to solve it
Thank you for your time!

How to use brainbeats output for LIMO?

Hello, I am trying to compare HEP on 2 conditions.
For this, I selected some part of my dataset and merged it into 1 file, and process with brainbeats_process

EEG_merged = [];
for i = 1:2:nEvents-1
start_latency = EEG.event(i).latency;
end_latency = EEG.event(i+1).latency;

EEG_temp = pop_select(EEG, 'point', [start_latency end_latency]);
if isempty(EEG_merged)
    EEG_merged = EEG_temp;
else
    EEG_merged = pop_mergeset(EEG_merged, EEG_temp, 0);
end

end
EEG_merged = brainbeats_process(EEG_merged,'analysis','hep','heart_signal','ECG','heart_channels',{'EKG'},'clean_rr','pchip','clean_eeg',true, 'parpool',false,'gpu',true,'vis',true,'save',true);
pop_saveset(EEG_merged, 'filename', [savefilename '_condition1_epoch.set'], 'filepath', savefolder);

after this job, I tried to use LIMO but It can't precompute, with error message 'eeg_getdatact error'
image

am I doing something wrong with brainbeats or there is something wrong with plugin? Sorry for low-level question..

Unable to process single subject

I am able to open the toolbox, but after I select all of the desired parameters and click Ok, I get the error message "EEGLab error in function run_checks() at line 160: Unable to resolve the name 'parallel.Settings'." I ran into this issue when using the sample data provided and when using my own data.

I use MATLAB version 2023b, EEGLab version 2024.0, and MacOS Sonoma 14.4.1. Please let me know if you need any more information.

Long computation time on GPUs

I compared the computation time of the nonlinear EEG measures and found something interesting: On my gaming machine (Ryzen 5800x, 32gb RAM, and RTX 3080) the computation time with just parallel computing, but no GPU computation was actually much lower. It took about 1h for method 2 without GPU, but 2h 10min when utilizing GPU computation. I repeated this measure twice with similar results. Perhaps the GPU array allocation can be made more efficient...

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.