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
{{ message }}
Repository navigation
pop_select: include the correct first sample for a 1-based point range #853
🤖 For a one-channel continuous recording containing 0:9 at 100 Hz, run pop_select(EEG, 'point', [2,5]). MATLAB R2025b on jamming returns four values [1, 2, 3, 4]. EEGPrep develop retains sample 1 as well and returns five values [0, 1, 2, 3, 4]. The rejected leading interval [1,1] is discarded by the range code. Cover both ends of a continuous recording. The BioSig reader implements its own inclusive sample range, so the #812 comparison is unaffected.
Earlier issue: #729, pop_select (Edit > Select data): graphical and numerical parity with EEGLAB
The kept range is converted to complement notime segments, shifted by one sample. For point=[2,5] the leading segment is [0,0] s, which maps to points [1,1]. keep_rows = (pts[:,1]-pts[:,0]) != 0 drops it, but eeg_eegrej ranges are inclusive, so [1,1] is one sample. The trailing [10,10] for point=[k,9] hits the same bug.
A follow-up on the last sample, which came out of the review of pull request #856 for this issue. Arno decided on November 29, 2026 to fix EEGLAB and to keep EEGPrep as it is, so nothing changes in EEGPrep.
Counts on the 9,243 point ranges (10 and 37 samples, 13 sampling rates): EEGLAB and EEGPrep differed in 129 ranges and now differ in 0. EEGLAB did not return the requested samples in 285 ranges and now in 156, which EEGPrep reproduces (another cause, the rounding of eeg_point2lat to 1e-9 s at 300, 1024, 2048 and 30000 Hz).
Still open: on recordings longer than 8,192 samples EEGPrep keeps the last sample at 250, 500 and 1000 Hz (9 of 280 calls tested), which is #867 with a question for Arno, and the adjacent keep ranges of #864.
Activity
claude commentedon Nov 29, 2026
🤖 Plan:
point=[2,5]keeps[0..4],point=[2,9]keeps all 10 samplestests/test_pop_select.py(both ends)point=[2,5]on 0:9 now returns[1,2,3,4])Research
The kept range is converted to complement
notimesegments, shifted by one sample. Forpoint=[2,5]the leading segment is[0,0]s, which maps to points[1,1].keep_rows = (pts[:,1]-pts[:,0]) != 0drops it, but eeg_eegrej ranges are inclusive, so[1,1]is one sample. The trailing[10,10]forpoint=[k,9]hits the same bug.Relevant code
src/eegprep/functions/popfunc/pop_select.py#L491-L508- complement shift + zero-length filterProposed Fix
Keep rows where
end >= start(inclusive one-sample ranges), and drop only inverted rows.arnodelorme commentedon Nov 29, 2026
A follow-up on the last sample, which came out of the review of pull request #856 for this issue. Arno decided on November 29, 2026 to fix EEGLAB and to keep EEGPrep as it is, so nothing changes in EEGPrep.
eeg_point2latto 1e-9 s at 300, 1024, 2048 and 30000 Hz).— orchestrator