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

2 次查看(过去 30 天)
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 个评论
Taylor
Taylor 2024-1-10
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.

请先登录,再进行评论。

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 EEG/MEG/ECoG 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by