Repository navigation
fix: interpolate only the requested time range - #980
Conversation
Co-authored-by: Suraj Ranganath <[email protected]>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Co-authored-by: Suraj Ranganath <[email protected]>
|
@arnodelorme this is the fix for the pop_interp time range issue from our eegprep GUI audit, ready for your review.
Checked in MATLAB: samples outside the range are bit-identical to the input, values inside match unrestricted interpolation exactly, and calls without a range ( Suraj |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
This pull request fixes three issues with time-range channel interpolation in
— orchestrator |
pop_interp was clearing a scripted time range, and a range chosen in the GUI never appeared in the history command. Both now follow the help: a passed range is kept, and a filled dialog field is recorded. Calls that omit the range, including pop_reref and the Tools menu, still interpolate the whole recording.
eeg_interp then restored original samples with floor(tsrate) and stopped at floor(xmaxsrate). On sample_data/eeglab_data.set that left the sample at 3 s unchanged and still replaced the final sample. The window now comes from EEG.times (milliseconds, same limits as xmin/xmax). Samples inside [tmin, tmax] are interpolated, both endpoints included, and every other sample is copied back from the input. The same latency window is applied in each epoch. A new channel supplied as a chanlocs structure has nothing to restore, so that path is unchanged.
On this recording, [1 3] s is samples 129 through 385. Sample 384 (2.992 s) is inside the window; sample 386 and sample 30504 are not. MATLAB is required for the spline itself. The checks below should print 0 for every outside difference, 1 for the endpoint changes, and a positive difference for each 3-argument call.