Skip to content

pop_importepoch (File > Import epoch info > From MATLAB array or ASCII file): graphical and numerical parity with EEGLAB #738

Backlog
3 of 3 issues completed

Description

@arnodelorme

EEGPrep checks each EEGLAB function on its own, in one issue, for both the window and the numbers (Arno, November 26, 2026). This issue is pop_importepoch, File menu: Import epoch info > From MATLAB array or ASCII file. It stays open until the window and the numbers are both acceptably close to EEGLAB's, even when a pull request is merged or closed.

Graphics

The same change as a real window on the Mac: develop, then pull request 770.

importepoch_mac_real

One edit column for every row (issue 769). Linux: EEGLAB before and after (sccn/eeglab#993), EEGPrep before and after (pull request 770).

importepoch_linux

Numerical difference with EEGLAB

hist_pop_importepoch

9 of 10 test cases give exactly EEGLAB's events. With no time unit the same 159 events come in another order: EEGLAB sorts all events by latency, EEGPrep keeps them grouped by epoch. In the 9 cases in orange the numbers are the same and EEGPrep's EEG.epoch has one more field, eventurevent.

Earlier captures

EEGPrep before and after (issue 704): the edit box of the first row is now above the others.

704_eegprep

EEGLAB before and after the same two-line change of pop_importepoch.m.

704_eeglab

EEGLAB's wording for three labels (issue 758, pull request 760, merged): EEGLAB, EEGPrep before, EEGPrep after.

758

November 27, issue 769: one edit column for every row. EEGLAB before and after (sccn/eeglab#993), EEGPrep before and after (pull request 770).

769

Captured on jamming under a virtual screen (EEGLAB with getframe, EEGPrep with the Qt widget grab), and on the Mac where said.

The window: what differs from EEGLAB
The numbers: same file in both programs
  • Not tested: no real epoch information file was at hand (case N18 of the File menu report was not run).
Files

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    function-parity
    on Nov 27, 2026
  2. claude commented on Nov 27, 2026

    @claude
    Contributor

    🤖 Plan:

    • Read issue and compare pop_importepoch dialog with EEGLAB functions/popfunc/pop_importepoch.m (develop)
    • Duplicate-work preflight: [GUI] Align pop_importepoch field-names row with rows below #714 (row alignment) is the only open PR on this dialog
    • Label wording: blocked on Arno's decision (issue says the window waits on him); no PR opened
    • Numerical test: blocked on a real epoch information file + MATLAB run

    Research

    Not actionable for an agent PR yet: both remaining items need a human (wording choice, a real data file). The three label differences are in the dialog spec; the hint column also differs.

    Relevant code

    Row EEGPrep EEGLAB
    type field Field containing time-locking event type(s) Field name containing time-locking event type(s)
    time unit Time unit (sec) Latency time unit rel. to seconds. Ex: ms -> 1E-3 (NaN -> samples)
    header lines Number of file header lines Number of file header lines to ignore
    hints (col 3) 0 = no duration, Default: TLE NOTE with tooltip (helpstrdur, helpstrtype)

    Note: EEGLAB's (NaN -> samples) text is misleading for this function. finputcheck restricts timeunit to [0 Inf], so NaN is rejected in EEGLAB; EEGPrep would just produce NaN latencies. If the EEGLAB label is copied verbatim, EEGPrep should reject NaN the same way.

    Proposed Fix

    Once Arno picks the wording: copy the three EEGLAB labels into pop_importepoch_dialog_spec (about 3 lines changed), ideally rebased on #714 so the two don't conflict. Keeping the EEGPrep hint text instead of NOTE is a separate decision.

    For the numbers: run pop_importepoch on the same tab-separated file in both programs (for example, one row per epoch of sample_data/eeglab_data_epochs_ica.set with columns Epoch RT Type, latencyfields={'RT'}, timeunit=1e-3, headerlines=1). Then compare EEG.event (type, latency, epoch) and EEG.epoch against MATLAB. A parity test can extend tests/test_file_menu_audit_673.py (File menu report case N18). Missing to proceed: the wording decision and a confirmed real epoch file, or approval to use the synthetic file above.

  3. arnodelorme commented on Nov 27, 2026

    @arnodelorme
    CollaboratorAuthor

    Arno wrote on November 27, 2026: "pop_importepoch -> currently no alignment. This was fixed but reverted. There was one fix that did align everything, but I think then it was reverted, and I'm not sure why. I think the MATLAB version was also fixed. Double-check and try to find the issue."

    • EEGPrep: nothing was reverted. The fix of pull request [GUI] Align pop_importepoch field-names row with rows below #714 is still in develop (11743a2), but it only aligned the "File input field (col.) names" row with the three rows below it. The window still has three different left edges for its edit boxes, so it reads as not aligned.
    • EEGLAB: this is where the revert happened. The fix was pushed to develop without a pull request (3d3ad9aa3), reverted by pull request 988, and proposed again as pull request 993, which is still open: [GUI] Put every pop_importepoch edit box in one column eeglab#993
    • Next step: one small pull request that gives every row of the window the same edit column, in EEGPrep and in EEGLAB (in pull request 993 or a follow-up), with before and after captures.
    Measured on develop, native Mac style, window 900 by 350
    Row Left edge of the edit box or checkbox Geometry
    Epoch file or array 405 px [1, 1, 1.86]
    File input field (col.) names, latencies, durations, event type 485 px [2.5, 1, 1]
    Latency time unit, header lines, remove old info 590 px [2, 0.5, 0.5], [2, 0.3, 0.7]

    The bottom three rows keep EEGLAB's own geometry [2 0.5 0.5], which EEGLAB does not align with the [2.5 1 0.6] rows either. No branch of sccn/eegprep holds a version where all rows share one column: the only two geometries in the history of the file are the one before #714 and the one after.

    — orchestrator

  4. suraj-ranganath commented on Nov 28, 2026

    @suraj-ranganath
    Member

    On develop (aa81d9ab), load the tutorial epochs and import epochinfo.txt with fields epoch RT cond, latency field RT, time unit 0.001, one header line and existing events retained. Accept once. The last two lines of EEG.history are identical pop_importepoch calls.

    EEGLAB passes the returned command to dataset storage once. In EEGPrep the wrapper and the menu both append it. Record it in one place and keep the session's dataset-selection entry. After saving and reopening, check the new events and latencies and count one import line. A single console import should also give one line, and two deliberate imports should give two. eeglab.m L590 · pop_importepoch.m L133 · menu_actions.py L803

  5. arnodelorme commented on Nov 29, 2026

    @arnodelorme
    CollaboratorAuthor

    🤖 pop_importepoch: accept event information for a single selected sweep. #843

    — EEGPrep worker (Codex)

  6. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    CollaboratorAuthor

    🤖 New Linux layout finding for pop_importepoch, with before and after captures and numerical verification, is tracked in #916 and PR #915.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    function-parity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions