Skip to content

pop_importdata (File > Import data > From ASCII/float file or MATLAB array): graphical and numerical parity with EEGLAB #737

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_importdata, File menu: Import data > From ASCII/float file or MATLAB array. 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

Pull request 776 now: no fixed height, the window is as high as its rows, 28 pixels each (rule 26). Linux: EEGLAB, EEGPrep before, EEGPrep after. The Mac capture comes tonight.

importdata_rows_linux

Numerical difference with EEGLAB

hist_pop_importdata

All 10 test cases give exactly EEGLAB's result (data, sampling rate, channels, points, epochs, times, channel locations, dataset fields).

Earlier captures

The window (issue 700): EEGLAB, EEGPrep before, EEGPrep after. The rows now share the height and the note on channel locations is back.

700

Enter comments button and two bold labels (issue 756, merged as pull request 759): EEGLAB, EEGPrep before, EEGPrep after. The capture is of the first version, pull request 757, closed as a duplicate.

756

The window with the shared row heights of pull request 722 as well, next to EEGLAB.

756_with722

November 27, issue 775: EEGLAB, EEGPrep develop (1150 by 480) and EEGPrep with the height of its content (1150 by 389), on jamming.

importdata_height

The same with the native Mac style: develop and after.

importdata_height_mac

After Arno's answer (too much space, then not enough): real window on the Mac at 480, 385 and now 430 pixels (pull request 776).

importdata_mac_real

The same on jamming, with EEGLAB (450) on top.

importdata_linux_430

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
  • EEGLAB has an Enter comments button where EEGPrep had an edit box, and two more labels are bold in EEGLAB. Both are merged (pull request 759).
  • EEGPrep lists Auto detect as the first data format (finding F17).
  • Arno on his Mac, November 27: still a lot of vertical blank space. The window was fixed at 1150 by 480 and its 13 rows shared that height. A first version let the content set the height (385 pixels), which he found too tight. Pull request 776 is now 430 pixels high, in the middle.
The numbers: same file in both programs
  • eeglab_data.fdt (float32): the same data and fields (case N10).
  • EEGLAB needs 'nbchan' before 'data' in the call. EEGPrep accepts either order (case N9).
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:

    Research

    Each of the three window items in "What remains" can be traced to pop_importdata_dialog_spec. EEGLAB uses a pushbutton for comments that stores its text in the figure userdata and returns it as the second output of inputgui (newcomments). EEGPrep's DialogSpec has no hidden or userdata value, so EEGPrep shows an edit box tagged comments instead.

    Relevant code

    Proposed Fix

    1. Bold labels (small): EEGLAB makes "Data sampling rate (Hz)" and "Channel location file or info" bold ('fontweight','bold'). Add font_weight='bold' to those two ControlSpec('text', ...) entries. EEGLAB also makes the format popup bold, and ends the two ICA labels with a colon and writes "from other dataset" in lower case. Fold those into the same change if exact matching is wanted.
    2. Auto detect (decision needed): EEGLAB's popup has only 5 entries ("Matlab variable|ASCII text file|float32 le file|float32 be file|Matlab .mat file"), selects entry 1 by default, and its Browse callback (commandsetfiletype) picks the format from the extension (.mat→5, .fdt→3, .txt→2). There are two options:
      a. Match EEGLAB: drop "Auto detect", default to entry 1, and make the Browse callback set dataformat from infer_dataformat. The 'auto' keyword stays for command-line use only.
      b. Keep "Auto detect" but move it to the end and default to entry 1, which only partly fixes F17.
      I recommend (a), because it keeps the useful inference and matches the window.
    3. Enter comments button (needs a change to the shared GUI code): replace the comments edit box with ControlSpec('pushbutton', 'Enter comments', tag='enter_comments', callback=CallbackSpec('run_dialog_action', ...)). The action calls pop_comments(...) and stores the text in a dialog value that the button does not show. Two ways to store it:
      a. Add generic dialog state to inputgui/the Qt renderer that update({...}) can write and the results return, like MATLAB userdata. This affects every dialog.
      b. Keep a hidden edit control tagged comments (needs a visible=False option on ControlSpec if none exists).
      (b) is smaller. Either way, pop_editset's dialog may want the same button later.

    Suggested order: wait for #722 to merge, then one sub-issue/PR for 1+2 (about 20 lines plus a dialog-spec test) and one for 3 (GUI code plus a test that clicks the button, enters text, and checks that comments reaches EEG['comments']). The numbers part needs no change: accepting 'data' before 'nbchan' (N9) is a harmless superset of what EEGLAB accepts.

    Questions: For item 2, (a) or (b)? For item 3, generic dialog state (a) or a hidden control (b)?

  3. arnodelorme commented on Nov 27, 2026

    @arnodelorme
    CollaboratorAuthor

    Arno wrote on November 27, 2026: "pop_importdata GUI still has a lot of vertical blank space below the text and the buttons to cancel and ok."

    • Measured on develop (11743a2), native Mac style: the window has a fixed size of 1150 by 480 pixels, and since pull request [GUI] Share dialog height among rows and add the pop_importdata note #722 its 13 rows share that height evenly: each row gets about 32 px for controls about 22 px high, and the two empty rows take 32 px each. The blank space is spread between the rows and above the Help, Cancel and Ok row.
    • Next step: compare the height with EEGLAB's window for the same content (EEGLAB sizes the figure from the number of rows) and reduce the fixed height, or let the content set it, with before and after captures.

    — orchestrator

  4. suraj-ranganath commented on Nov 28, 2026

    @suraj-ranganath
    Member

    On develop (aa81d9ab), open the ASCII/float/MATLAB array import, enter a dataset name, leave the data field blank and click Ok. The form closes before “requires a data file or array” appears. Retrying means typing the name and options again.

    Validate the data field before closing, keep the other values and return focus to the missing input. Check that choosing the 4 × 512 fixture from that same form imports all 2,048 samples, adds one dataset and records one command. Cancel after the error should discard the entry. pop_importdata.m L243 · pop_importdata.py L33

  5. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    CollaboratorAuthor

    🤖 New Linux layout finding for pop_importdata, with before and after captures and numerical verification, is tracked in #922 and PR #921.

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