amisepa / BrainBeats

The BrainBeats toolbox, implemented as an EEGLAB plugin, allows joint processing and analysis of EEG and cardiovascular signals (ECG/PPG).
GNU General Public License v3.0
5 stars 4 forks source link

How to use brainbeats output for LIMO? #24

Closed npdrbong closed 8 months ago

npdrbong commented 1 year ago

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..

npdrbong commented 1 year ago

I think this essue is from brainbeats_process makes different lengths of HEP, while EEGLAB study needs to have same length of epochs to do something more.

amisepa commented 1 year ago

Hi, Doesn't this error suggest that one of your files is continuous and the other is epoched? Did they merge correctly? Did you update the field EEG.trials (i.e. number of epochs or events in the dataset)? At the end of your code, run this command to make sure everything is good: EEG = eeg_checkset(EEG);

If so, let me know the different lengths of the epochs. I have a solution and improvement that I will try to implement soon.

thanks

amisepa commented 11 months ago

@npdrbong Did you find what the problem was? I can confirm that BrainBeats does not segment epochs at different lengths. I think your problem comes form incorrect merging your datasets.

amisepa commented 10 months ago

Sorry you're right, because people have different heart rates, the epochs have different lengths across participants. I'm working on solving this at the STUDY level. It will probably take a while before this is fixed though as I have limited time over the next several weeks. Sorry about that.