You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I imported a data file, removed long pauses between blocks using pop_select(), and then resampled the data. Prior to resampling, there were 16 boundary events in my data file, all with correct latencies where data had been removed. After resampling, all of the boundary events been moved to the start of the file, with all latencies set to 0.5.
The problem appears to be due to lines 228 and 229 in pop_resample():
The result of those lines is that the prior value of EEG.event(iEvt).latency is not used to compute the revised value of EEG.event(iEvt).latency: For all events in the dataset, iBnd is set 1, and the revised latency is set to 0.5.
This issue can be demonstrated using the sample EEGLAB data set, as demonstrated below. Note that this occurs if (and only if) the "use type "-99" for boundary events" box is checked in the EEGLAB preferences window.
% load file
EEG = pop_loadset('filename','eeglab_data.set','filepath','/Library/MathWorks/MATLAB/eeglab2024.0/sample_data/');
% remove 1s of data every 30s
times_to_remove = [29 30; 59 60; 89 90; 119 120; 149 150; 179 180; 209 210];
EEG = pop_select(EEG, 'rmtime', times_to_remove);
% create event list using ERPLAB
EEG = pop_creabasiceventlist( EEG , 'AlphanumericCleaning', 'on', 'BoundaryNumeric', { -99 }, 'BoundaryString', { 'boundary' } ); % GUI: 25-Feb-2025 11:58:43
% boundary event latencies are correct
[EEG.event([EEG.event.type]==-99).latency]/EEG.srate
% downsample to 64 Hz
EEG = pop_resample(EEG, 64);
% boundary event latencies are incorrect iff "use type "-99" for boundary
% events" preference box is checked
[EEG.event([EEG.event.type]==-99).latency]/EEG.srate
The text was updated successfully, but these errors were encountered:
I imported a data file, removed long pauses between blocks using pop_select(), and then resampled the data. Prior to resampling, there were 16 boundary events in my data file, all with correct latencies where data had been removed. After resampling, all of the boundary events been moved to the start of the file, with all latencies set to 0.5.
The problem appears to be due to lines 228 and 229 in pop_resample():
The result of those lines is that the prior value of EEG.event(iEvt).latency is not used to compute the revised value of EEG.event(iEvt).latency: For all events in the dataset, iBnd is set 1, and the revised latency is set to 0.5.
This issue can be demonstrated using the sample EEGLAB data set, as demonstrated below. Note that this occurs if (and only if) the "use type "-99" for boundary events" box is checked in the EEGLAB preferences window.
The text was updated successfully, but these errors were encountered: