DouweHorsthuis/EEG_to_ERP_pipeline_stats_R

EEG.event problem

DouweHorsthuis opened this issue · 3 comments

figure out why EEG.event created edftypes with condition and without

This seems to not happen if I use EEGLAB eeglab14_1_2b...

It seems to be a problem with my personal eeglab. if anyone else has this problem where EEG.event sometimes add 'condition' to the trigger but not always, use this code before epoching:

for i =1:length(EEG.event)%something odd, where eeg.event is irregular
if contains(EEG.event(i).type, 'boundary') %skipping the boundary events
continue
elseif ~isempty(EEG.event(i).edftype)
EEG.event(i).type = char(['condition ' num2str(EEG.event(i).edftype)]); %making sure that the edf are fixed first
else
new=EEG.event(i).type;
EEG.event(i).edftype=str2double(new); %fixing edftype
EEG.event(i).type = char(['condition ' new]); %making sure that it's edf fixed first
end
end