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.
- Saved my .bdf file as a .set file in EEGLAB
- Load data into EEGLAB: File > Load existing dataset >MGpractice231123_1524.set
- Tools>Brainbeats>process file at subject level
- 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
- All other ticks in boxes are left as automated
- 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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1562779/image.jpeg)
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
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
2024년 1월 10일
Change
EEG.event(shortTrials).type = [];
to
for ST = shortTrials(:).'
EEG.event(ST).type = [];
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!