-
Notifications
You must be signed in to change notification settings - Fork 1
Description
If EEG struct is epoched and only one epoch is extraxted, lenght(EEG.epoch) becomes 0.
eegtoolPreprocess fixes this on line 329 by setting the function's "local variable" epochs to 1 as shown below.
% eeglab bug or "feature" of not putting epochs to 1 at all
if epochs == 0
epochs = 1;
end
eegtoolPreprocess or it's subfunctions also refer to to the eeglab's EEG struct's EEG.epoch. I think that, in the case that this becomes empty as described above, it should be assigned values by modifiying the loop on line 318.
% Add urepoch-field to epoch-substruct (reason: to preserve
% original epoch numbering
for k=1:length(EEG2.epoch)
EEG2.epoch(k).urepoch = k;
end
This loop should be moved below the code where "eeglab bug or "feature" of not putting epochs to 1 at all" is fixed. The loop should be modified to
% Add urepoch-field to epoch-substruct (reason: to preserve
% original epoch numbering
for k=1:length(epochs)
EEG2.epoch(k).urepoch = k;
end