Azzera filtri
Azzera filtri

Error in function run_HEP() in EEGLAB when running plug in BrainBeats for HEP extraction

2 visualizzazioni (ultimi 30 giorni)
I am using the BrainBeats plug in feature of EEGLAB, hoping to use this for extracting and analysing Heartbeat Evoked Potentials from my EEG data. It's quite a new plugin, so I'm using the only version (BrainBeats1.1) which can be downloaded here:
I have loaded my biosemi .bdf EEG data into EEGLab on Matlab and saved as a .set file after assigning channel locations and rereferencing to mastoids. I have then opened .set file in Brainbeats1.1 and tried to extract Heartbeat Evoked Potentials.
Brainbeats paper contains instructions
Cannard, C., Wahbeh, H., & Delorme, A. (2023). BrainBeats: an open-source EEGLAB plugin to jointly analyze EEG and cardiovascular ( ECG / PPG ) signals. 0–26.
I can run the script (method 1) until receiving error message.
  1. Saved my .bdf file as a .set file in EEGLAB
  2. Load data into EEGLAB: File > Load existing dataset >MGpractice231123_1524.set
  3. Tools>Brainbeats>process file at subject level
  4. Select "Heartbeat-evoked potentials HEP" as analysis to run, "ECG" as heart data type, select the ECG channels labeled > 'EKGl' is my heart beat channel
  5. All other ticks in boxes are left as automated
  6. Select Ok
It runs for a while and produces some graphs (after I'd installed plug ins to solve previous error messages). Now I get an EEGLAB error message stating: "EEGLAB error in function run_HEP() at line 41: Assigning to 2 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment." I didn't want to fiddle with code of built in functions in EEGLAB?
So line41 of run_HEP function relates to: EEG.event(shortTrials).type = [];
See context below:
% Remove trials with IBI<550 ms. see Candia-Rivera et al. (2021) and Park & Blanke (2019)
shortTrials = find(IBI<550);
if ~isempty(shortTrials)
warning('Removing %g trials with interbeat intervals (IBI) < 550 ms', length(shortTrials))
IBI(shortTrials) = [];
EEG.event(shortTrials).type = [];
else
fprintf('All trial have an interbeat interval (IBI) above 550 ms (minimum recommended). \n')
end
The warning I get in command window before the error message is relevant:
Warning: Removing 2 trials with interbeat intervals (IBI) < 550 ms
Here is the .set data file I am working with
I also have two run_HEP file paths, however removing one at a time doesn't help.
C:\Program Files\MATLAB\R2023b\toolbox\BrainBeats-eeglab_v1\functions
C:\Program Files\MATLAB\R2023b\toolbox\eeglab2023.1\plugins\BrainBeats1.1\functions
Can anyone please tell me how I might rectify this? Advice much appreciated
  1 Commento
Taylor
Taylor il 10 Gen 2024
I would recommend reaching out to the EEGLAB discussion board. It is such a complicated third-party toolbox, people on Answers generally don't want to dig through all of their source code to find the root cause.

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 10 Gen 2024
Change
EEG.event(shortTrials).type = [];
to
for ST = shortTrials(:).'
EEG.event(ST).type = [];
end

Categorie

Scopri di più su EEG/MEG/ECoG in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by