Skip to content

GUI audit Nov 23: Edit and Tools fixes (DIPFIT co-registration and fine fit, epoched Select data, firpmord, Inspect/label components) #675

Done

Description

@suraj-ranganath

Summary

Hands-on GUI audit of the Edit and Tools menus on Nov 23, 2026, done as a researcher would: real menu clicks in the eegprep Qt GUI next to the EEGLAB GUI on the same screen, the same real datasets in both, every result saved and compared (cmp.py: data, events, chanlocs, ICA). This issue collects every Edit and Tools finding (FAIL, MINOR, MISSING) plus the Nov 5 findings that are still open here (F47, F55, F56 partial, F57, F113, F114, F115 history, F117), so one PR can fix them together. File-menu findings are in the companion issue #673 (File/data I/O stream).

  • eegprep: develop at 6b8012cf2e1f7f1e336e963b77b464754393cbf3 (re-checked with git fetch origin develop on Nov 23 11:05 PST: develop has not moved, so every file:line below is current)
  • EEGLAB: pinned tree 8ac485f6 (Fieldtrip-lite, dipfit, firfilt, ICLabel, clean_rawdata from the pin; viewprops from the bench copy where noted)
  • Each finding was re-read from first principles against the EEGLAB source; where that changed or refined the audit's root cause, the refined cause is given.
  • Already handled on develop, nothing to do beyond the GUI retest: F60 (EEGLAB pop_interp.m:61 discards t_range; eegprep keeps it, documented in docs/source/user_guide/preprocessing_pipeline.rst:337 and changelog.rst:703).

Datasets used

  • eeglab_data.set and eeglab_data_epochs_ica.set from sample_data/; eeglab_chan32.locs and standard-10-5-cap385.elp from EEGLAB sample_data/ and functions/supportfiles/.
  • Tools chain set (Session A): eeglab_data.set -> readlocs -> Select data -> Basic FIR 1 Hz high-pass -> resample 100 Hz -> windowed-sinc 30 Hz -> firpm -> moving average -> reref average -> interp -> manual rejection -> clean_rawdata defaults (ml_clean.set, 30 ch x 23279) -> runica extended (ml_ica.set, 30 ICs) -> ICLabel -> flag eye 0.5 (comp 11) -> remove comp 11 -> extract epochs square -1 2 (69 epochs x 300) -> rmbase. DIPFIT rows ran on the 69-epoch ICA set (unit-sphere tutorial chanlocs, 29 ICs). For a quick repro eeglab_data_epochs_ica.set shows the same DIPFIT behaviour (same unit-sphere locations).

Evidence (screenshots and saved sets from both tools) is on the bot box under /workspace/gui-parity/audit-20261123/ (screenshots/, epout/, mlout/, findings.md, items_final.json). File names are quoted per finding.

Separability with #673 (File/data I/O)

This stream owns: functions/guifunc/qt.py, the shared inputgui validation path, functions/popfunc/ Edit/Tools functions (pop_select, pop_editset, pop_editeventvals, pop_chanedit, plot_utils, pop_rmdat, pop_selectevent, pop_mergeset, pop_runica, pop_selectcomps, pop_prop, pop_subcomp), plugins/firfilt/, plugins/clean_rawdata/, plugins/ICLabel/, plugins/dipfit/, and Edit/Tools handlers in functions/guifunc/menu_actions.py. Edit > About this dataset (comments saved as one row) is fixed in pop_saveset, so it lives in #673 (item 27).


A. High and medium (FAIL / MISSING)

1. DIPFIT > Head model and settings: unscaled default transform, Co-register and channel picker disabled, wrong fits (FAIL, high; F113/F114)

  • Repro: on the 69-epoch ICA set (or eeglab_data_epochs_ica.set), Tools > Source localization using DIPFIT > Head model and settings, accept defaults, Ok; then Tools > ... > Component dipole autofit, components 1:3, Ok. In EEGLAB do the same; EEGLAB refuses Ok, so reopen, Co-register, Warp montage, Pair channels Ok, coregister Ok, Ok.
  • eegprep now: opens on Template BEM (MNI) with file names filled (F65 fixed), but Co-register and the channel-omit ... are always disabled and the matrix is prefilled with 0 0 0 0 0 -1.5708 1 1 1. Ok accepts it silently, so unit-sphere positions are used as millimetres: autofit 1:3 gives RV 8% / 21% / 18% at [18 -78 54], [26 -11 77], [-55 -26 54]; EEGLAB gives 2.6% / 0.9% / 2.2% at [-6 -21 48], [-24 -76 22], [18 -65 21]. With EEGLAB's warp [0.49 -17.23 2.24 0.10 0.005 -1.574 98.2 90.5 98.6] typed in, eegprep gives exactly EEGLAB's dipoles (positions to 0.01 mm, RV to 4 digits), so the fit engine is right (screenshots/ep_dipset_dlg_20261123_091358.png, ml_dipset_ok_20261123_091427.png, ml_warp_20261123_091518.png, ml_warped_20261123_091609.png).
  • EEGLAB: plugins/dipfit/pop_dipfit_settings.m:139 calls lookupchantemplate(chanfile, templates(valmodel).coord_transform) and functions/sigprocfunc/lookupchantemplate.m:50-62 returns transform = [] when no keyword matches; :125-134 then leaves the matrix empty; :581-587 refuses Ok with "INCORRECT SETTINGS ... You must co-register your channel locations with the head model ... To bypass co-registration, check the checkbox No Co-Reg."; :238-239,267 wire Co-register (coregister) and the channel picker (pop_chansel).
  • Root cause: src/eegprep/plugins/dipfit/_utils.py:62 gives each template a scalar coord_transform (no EEGLAB counterpart: dipfitdefs.m:75-82 holds only keyword-matched transforms), and pop_dipfit_settings.py:70-77 falls back to it when lookupchantemplate finds nothing; pop_dipfit_settings.py:139 and :143 create Co-register and ... with enabled=False; pop_dipfit_settings.py:173-176 accepts an empty matrix without No Co-Reg.
  • Fix: drop the scalar fallback; leave the matrix empty when no template matches; refuse Ok with EEGLAB's message (naming pop_dipfit_settings) unless a matrix is present or No Co-Reg is ticked; enable Co-register and wire it to the existing functions/guifunc/coregister.py dialog and functions/sigprocfunc/coregister.py (warp='auto' = Warp montage, alignfid); enable ... with pop_chansel. Also support coord_transform='warpfiducials'|'alignfiducials' as pop_dipfit_settings.m:378-386.
  • Test: spec/GUI tests (empty matrix on tutorial locs, Ok refused, Co-register enabled); a parity test that Warp montage on the tutorial set reproduces EEGLAB's 9 parameters within the existing coregister parity tolerance, then autofit 1:3 equals EEGLAB's positions/RV (MATLAB script on jamming; reuse tests/matlab/eegprep_coregister_parity.m).
  • No silent unscaled default; Ok refused like EEGLAB
  • Co-register (Warp montage) and channel omit work from the dialog
  • Autofit 1:3 after GUI co-registration matches EEGLAB

2. DIPFIT > Component dipole fine fit crashes after autofit (FAIL, high; F56 follow-up)

  • Repro: after item 1's autofit 1:3, Tools > ... > Component dipole fine fit.
  • eegprep now: error before the dialog: pop_dipfit_nonlinear: float() argument must be a string or a real number, not list (screenshots/ep_dip_Component_dipole_fine_20261123_092101.png). The Nov 5 crash (F56, _utils.py:168) is gone; this is a new one.
  • EEGLAB: "Manual dipole fit -- pop_dipfit_nonlinear()" opens on component 1, RV 2.56%, position/moment rows, Fit / Plot buttons (ml_dip_fine_20261123_092548.png).
  • Root cause: src/eegprep/plugins/dipfit/pop_dipfit_nonlinear.py:161 numeric_vector(model["posxyz"]) gets the nested list [[x, y, z]] that plugins/dipfit/dipfit_gridsearch.py:74 stores (dip["pos"].tolist() of a (1, 3) array, kept through pop_multifit; pop_multifit.py:169 builds the same shape for pairs) and functions/miscfunc/value_parsing.py:70 calls float() on the inner list.
  • Fix: store posxyz/momxyz as (ndip, 3) float arrays everywhere (pop_multifit, gridsearch, nonlinear), as EEGLAB does (pop_multifit.m:172-184), and read them with np.asarray(..., float).reshape(-1, 3) in the dialog.
  • Test: autofit then open fine fit through the renderer; dialog shows RV and the first dipole; Fit updates the model; same result as EEGLAB on component 1.
  • Fine fit opens and fits after autofit

3. Edit > Select data on epoched data keeps 129 points (FAIL, medium; F44 partial)

  • Repro: load eeglab_data_epochs_ica.set, Edit > Select data, time range -0.5 0.5, epochs 1:2:9, Ok, pop_newset Ok, save; compare with EEGLAB.
  • eegprep now: 8 events (F44 events fixed) but 129 points and xmax 0.5; EEGLAB has 128 points and xmax 0.4921875, so event latencies drift by 1 sample per epoch (max 4). Continuous selection is identical to EEGLAB (maxdiff 0, 36 events).
  • EEGLAB: functions/popfunc/pop_select.m:526-528 calls epoch(EEG.data, alllatencies, [g.time(1) g.time(2)]*EEG.srate, ...); functions/sigprocfunc/epoch.m:106-107 uses round(lim(1)) .. round(lim(2) - 1), a half-open window; pop_select.m:534-535 sets xmin/xmax from the returned times.
  • Root cause: src/eegprep/functions/popfunc/pop_select.py:391-398 maps [tmin tmax] with eeg_lat2point and keeps both end points.
  • Fix: for epoched data compute the kept samples as epoch.m does (offsets round(tmin*srate) .. round(tmax*srate) - 1 relative to time 0), set xmin/xmax from them, and shift event latencies accordingly.
  • Test: epoched selection parity with EEGLAB (pnts 128, xmax 0.4921875, 8 events with EEGLAB latencies); edge cases tmin/tmax on and off the sample grid.
  • Also: out-of-range time 60 100 on 50 s data gives a clear message and keeps the dataset (EEGLAB corrects silently and continues); keep eegprep's behaviour, document it in eeglab_migration.rst, test it. The audit saw the Channel type ... enabled; on develop pop_select_dialog_spec disables it for eeglab_data.set (no types) and enables it for eeglab_data_epochs_ica.set (EEG/EOG types, where pop_select.m:133 enables it too), so only re-check this in the GUI retest.
  • 128 points and EEGLAB event latencies
  • Out-of-range behaviour documented and tested

4. Tools > Filter the data > Parks-McClellan: Estimate gives order 66 where EEGLAB gives 54 (FAIL, medium)

  • Repro: on the chain set (100 Hz), Tools > Filter the data > Parks-McClellan (equiripple) FIR filter, cutoff 40, transition 4, lowpass, Estimate with ripple 0.1 dB and attenuation 40 dB.
  • eegprep now: weights match (1.7372 / 1), but order 66, so the data differ (maxdiff 1.7 uV). With 54 typed, eegprep equals EEGLAB exactly.
  • EEGLAB: plugins/firfilt/pop_firpmord.m:95 calls MATLAB firpmord (Herrmann/Rabiner remlpord estimate); pop_firpm.m:181-183 then rounds up to even with ceil(forder/2)*2. Checked from first principles: edges [38 42]/50, dev = [0.0057564 0.01], remlpord gives L = 53.24, firpmord returns ceil(L) - 1 = 53, the GUI shows 54.
  • Root cause: src/eegprep/plugins/firfilt/pop_firpmord.py:55-59 uses the Kaiser-window formula with the smallest deviation, and rounds to even inside pop_firpmord (EEGLAB rounds in the pop_firpm callback, so command-line pop_firpmord returns 53).
  • Fix: port firpmord/remlpord (2-band formula D/df - fK*df + 1 with the published coefficients; for multiband take the max over transitions as firpmord does); return ceil(L) - 1; move the even rounding to the pop_firpm Estimate callback in qt.py.
  • Test: pop_firpmord([0.76 0.84], [1 0], [0.0057564 0.01]) returns 53; GUI Estimate shows 54; multiband case against MATLAB firpmord on jamming; pop_firpm output equals EEGLAB (maxdiff 0).
  • Order 54 in the GUI, 53 from the function, data equal

5. Tools > Inspect/label components by map: static grid, no pop_prop, no accept/reject (FAIL, medium; F56 partial, F57)

  • Repro: load ml_ica.set (30 ICs) in both; Tools > Inspect/label components by map, default 1:30, Ok; in EEGLAB click button 1, toggle ACCEPT -> REJECT, OK, OK.
  • eegprep now: a static matplotlib grid of the same maps; clicking a map does nothing; no per-component window, no toggles, no OK/Cancel. Marking only through a new text field "Components to mark for rejection". History EEG = pop_selectcomps(EEG, [1 ... 30], reject=[1]); (screenshots/ep_selectcomps_grid_20261123_090207.png, ml_selectcomps_grid_20261123_090153.png, ml_prop_comp1_20261123_090251.png). The property window does work from Tools > Classify components using ICLabel > Label components (pop_viewprops, F57 fixed there).
  • EEGLAB: functions/popfunc/pop_selectcomps.m:200-205 one pushbutton per map colored by gcompreject, callback pop_prop(EEG, 0, ri, gcbo, {'freqrange', [1 50]}); :216-221 Cancel, "Set threhsolds", "See comp. stats", OK writes EEG.reject.gcompreject. History pop_selectcomps(EEG, [1:30] );.
  • Root cause: src/eegprep/functions/popfunc/pop_selectcomps.py:33-95 draws a non-interactive figure plus a reject= field.
  • Fix: Qt grid of clickable maps (35 per page as EEGLAB) that open the existing functions/popfunc/pop_prop.py window with an ACCEPT/REJECT toggle reflecting back into the button colour; OK writes gcompreject, Cancel discards; add "Set thresholds" (EEGLAB's label has a typo; use the correct spelling and note it) and "See comp. stats" or document them; history EEG = pop_selectcomps(EEG, [1:30]); plus the eeg_store line EEGLAB writes on OK.
  • Test: renderer test clicks map 1, toggles reject, OK, asserts gcompreject[0] == 1; Cancel leaves flags unchanged; history string.
  • Clickable grid -> pop_prop -> OK writes gcompreject

6. DIPFIT > Create a head model from an MRI is not implemented (MISSING, low; F113)

  • Repro: Tools > ... > Create a head model from an MRI.
  • eegprep now: opens the dialog directly (no MRI file picker first), and Ok raises "MRI segmentation into a boundary-element head model is not implemented" (src/eegprep/plugins/dipfit/pop_dipfit_headmodel.py:36-40).
  • EEGLAB: plugins/dipfit/pop_dipfit_headmodel.m: file picker, then the headmodel dialog (MRI file, nasion/LPA/RPA, EEG/MEG, plot options), FieldTrip segmentation + BEM.
  • Expected: either port the pipeline (FieldTrip ft_volumesegment + ft_prepare_mesh + OpenMEEG/dipoli BEM, a large job) or, for this PR, keep the menu item visible but disabled with a tooltip that names the missing piece and the alternative (template BEM in Head model and settings), and document it in eeglab_migration.rst. Decision for Suraj/Arno; the disabled state is the minimum.
  • Ported, or disabled with tooltip and documented

7. DIPFIT > Distributed source component modelling (eLORETA) is not implemented (MISSING, medium; F117)

  • Repro: after Leadfield, Tools > ... > Distributed source component modelling, Ok.
  • eegprep now: dialog opens, Ok says "eLORETA source analysis is not implemented" (src/eegprep/plugins/dipfit/pop_dipfit_loreta.py:43-47). Before Leadfield the "run pop_leadfield first" message is clear.
  • EEGLAB: plugins/dipfit/pop_dipfit_loreta.m runs ft_sourceanalysis (eloreta) on the leadfield and plots with ft_sourceplot.
  • Expected: port eLORETA (the leadfield and sourcemodel already exist in EEG.dipfit.sourcemodel; eLORETA is a weighted minimum-norm iteration on that leadfield, FieldTrip ft_eloreta) with a parity test against FieldTrip-lite on jamming; if deferred, disable the item with a tooltip as in item 6.
  • eLORETA ported with parity, or disabled and documented

B. Minor

8. Edit > Dataset info: file/array rows disabled; error names no field (MINOR, low; F47)

  • Repro: eeglab_data.set, Edit > Dataset info; set name and subject (works, history EEG = pop_editset(EEG, 'setname', 'renamed', 'subject', 'S01');); then type abc in Data sampling rate.
  • eegprep now: channel location file, ICA weights, sphere and ICA channel rows and their "From other dataset"/"Browse" buttons are disabled (functions/popfunc/pop_editset.py:162-180); srate abc gives pop_editset: could not convert string to float: abc and the dialog closes (F47).
  • EEGLAB: pop_editset.m enables those rows (EEGLAB's own srate error is poor: "Matrix dimensions must agree").
  • Fix: enable the four rows with Browse (file) and From other dataset (index into ALLEEG), applying them as pop_editset(..., 'chanlocs', file, 'icaweights', ..., 'icasphere', ..., 'icachansind', ...); validation message pop_editset: Data sampling rate must be a positive number (got "abc"), dialog stays open (item 22).
  • Test: import weights/sphere from a file and from another dataset; equal to EEGLAB; error text test.
  • Rows enabled and working; F47 message names field and fix

9. Edit > Event values: Delete/Insert/Append and field buttons disabled; raw float display (MINOR, medium)

  • Repro: eeglab_data.set, Edit > Event values, Event Num 5 + Enter, Type zz, Event Num 999 + Enter, Ok.
  • eegprep now: navigation and edits are right (F35 fixed; 999 jumps to 154 where EEGLAB ignores it: keep, document), but Delete event, Insert event, Append event and the field-name sort buttons are disabled (pop_editeventvals.py:76,84,99,105); values show 2.0, 1.000068359375.
  • EEGLAB: buttons enabled; values via num2str(value, 5) (pop_editeventvals.m:161,190).
  • Fix: enable and implement delete/insert/append (the function already accepts 'delete', 'insert', 'append') and the sort buttons; format with 5 significant digits.
  • Test: renderer test deleting, inserting and appending; result and history equal EEGLAB's.
  • Buttons work; display matches

10. Edit > Channel locations: Enter fires the first button; Plot 2-D opens behind the dialog (MINOR, medium)

  • Repro: eeglab_data.set, Edit > Channel locations, type 5 in Channel number + Enter; then click Plot 2-D.
  • eegprep now: Read locations and Look up match EEGLAB (7e-14, 3.6e-14), but (1) Enter also triggers "Opt. head center" and opens its subdialog; (2) the Plot 2-D figure opens behind the modal dialog and cannot be raised (screenshots/ep_chanedit_enter_20261123_081846.png, ep_chanedit_plot2d_raised_20261123_082128.png). Look up default file is standard-10-5-342ch.locs (EEGLAB's template list differs).
  • Root cause: (1) src/eegprep/functions/guifunc/qt.py:244 creates body QPushButtons with Qt's default autoDefault=True inside a QDialog; (2) functions/popfunc/pop_chanedit.py:462 -> plot_utils.py:39 figure.show() shows an unparented window while the dialog is application-modal.
  • Fix: setAutoDefault(False) and setDefault(False) for body pushbuttons (Ok stays default) in qt.py:244; parent figure windows opened from a modal dialog to that dialog (or make the dialog window-modal) and raise_()/activateWindow() after show; align the Look up default list with pop_chanedit.m.
  • Test: Qt test: Return in an edit does not click body buttons; figure window is a child of the dialog and visible on top.
  • Enter only moves to the channel; Plot 2-D visible

11. Edit > Select data using events: single-choice event-type picker (MINOR, low)

  • eegprep now: result identical to EEGLAB (14282 pnts, 221 events); the ... picker is a single-choice QInputDialog.
  • EEGLAB: multi-select pop_chansel list.
  • Root cause: functions/popfunc/pop_rmdat.py:66-74 does not pass selectionmode="multiple", so qt.py:1275 uses QInputDialog.getItem (the multi-select branch exists at qt.py:1262-1272).
  • Fix: pass selectionmode="multiple" (as Extract epochs does after F124). Test: spec + renderer test selecting two types.
  • Multi-select picker

12. Edit > Select epochs or events: no confirmation, field buttons wrong (MINOR, low)

  • eegprep now: result identical (38 epochs, 76 events); no "keep 38 epochs (delete 42)" confirmation; field buttons are disabled and show the whole description as their label; label "Retain old event type name(s) in field named".
  • EEGLAB: pop_selectevent.m:533 questdlg2('Warning: keep N epochs (delete M ...)'); :150 short field names on buttons that show the description on click; :212 label "... in (new) field named:".
  • Root cause: functions/popfunc/pop_selectevent.py:101-140,390 puts _field_description in disabled buttons; no confirm step.
  • Fix: field name on the button, description in a message box on click; confirmation from the GUI path; EEGLAB label.
  • Confirmation, buttons and label match

13. Edit > Append datasets default indices (MINOR, low)

  • Result, ICA and history identical (F42 fixed). Default indices 1 2 vs EEGLAB 1: eegprep's default is more useful. Fix: document as deliberate in eeglab_migration.rst with a spec test (pop_mergeset.py:70-85).
  • Documented and tested

14. Tools > Filter the data > Windowed sinc FIR: window labels and Estimate dialog (MINOR, low)

  • eegprep now: result identical (forder 66, maxdiff 0); window list shows bare names; Estimate opens a one-field QInputDialog "Transition bandwidth (Hz)" default 1.0 (qt.py:1153).
  • EEGLAB: plugins/firfilt/pop_firws.m:94 labels Hamming (PB dev=0.002, SB att=-53dB) etc.; :248 Estimate calls pop_firwsord (srate, window, transition bandwidth, max passband deviation for Kaiser).
  • Fix: EEGLAB labels in plugins/firfilt/pop_firws.py:109; Estimate opens the existing plugins/firfilt/pop_firwsord.py dialog prefilled with srate and window.
  • Labels and Estimate dialog match

15. Tools > Reject data using Clean Rawdata and ASR: review window (MINOR, low)

  • eegprep now: same controls, defaults, history and channels removed; on the same input equal to EEGLAB (maxdiff 0). The pop-up is an eegplot browser with rejected periods highlighted (plugins/clean_rawdata/vis_artifacts.py).
  • EEGLAB: vis_artifacts superposes old (red) and new (blue) data with removed channels in red.
  • Fix: add the superposition mode to vis_artifacts (eegplot already supports data2 overlay) or document the different review window.
  • Superposition view or documented

16. Tools > Decompose data by ICA: algorithm list; seeded parity (MINOR, medium; F69)

  • eegprep now: same layout and history; list has AMICA, Infomax picard, FastICA picard where EEGLAB has SOBI x2, JADE and binica (functions/popfunc/pop_runica.py:27-29); default runs agree as run-to-run Infomax does (median matched r 0.88). F69 (identical input with rndreset 'no' still differs) was not re-run.
  • Fix: document the list difference; re-run F69 on jamming with fixed seeds on both sides and open a separate numeric issue if it still differs (no tolerance changes here).
  • Documented; F69 re-run reported in the PR

17. Tools > Classify components using ICLabel > Flag components as artifacts: history (MINOR, medium; F55)

  • eegprep now: same rows, defaults and result (comp 11); history EEG = pop_icflag(EEG, thresholds=[None None; 0.9 1; 0.5 1; ...]); runs nowhere.
  • EEGLAB: EEG = pop_icflag(EEG, [NaN NaN;0.9 1;0.5 1;NaN NaN;NaN NaN;NaN NaN;NaN NaN]);.
  • Root cause: src/eegprep/plugins/ICLabel/pop_icflag.py:159-165.
  • Fix: positional matrix with NaN. Test: history string; the line replays in eegprep's history runner.
  • Runnable history

18. Tools > Remove components from data: flagged question and confirmation missing (MINOR, low)

  • eegprep now: goes straight to the manual dialog with 11 prefilled; result equals EEGLAB (5e-5 uV); history EEG = pop_subcomp(EEG, [11], 0); (EEGLAB pop_subcomp( EEG, [], 0, 0);).
  • EEGLAB: pop_subcomp.m:92-93 "Components [11] flagged for rejection. Do you want to remove these components?" (Cancel / Manual rej. / Yes); :184-185 "Confirmation" with Plot ERPs / Plot single trials / Accept.
  • Fix: add both steps in the GUI path (functions/popfunc/pop_subcomp.py:40-75) using the existing compare plot; history as EEGLAB.
  • Both prompts; history matches

19. DIPFIT > Component dipole autofit: plot and history (MINOR, medium; F114/F115 history)

  • eegprep now: with the same transform the fit equals EEGLAB; the plot appears (F118 fixed) as a 3-D scatter with legend (no MRI slices, no Plot one/Next/Prev, no area labels); history pop_multifit(EEG, [1, 2, 3], threshold=100, rmout=off, ...).
  • EEGLAB: dipplot on the MNI MRI with navigation and area labels; history EEG = pop_multifit(EEG, [1:3] ,'threshold',100,'dipplot','on','plotopt',{'normlen' 'on'});.
  • Root cause: src/eegprep/plugins/dipfit/_utils.py:116-121 dipfit_history writes Python keywords for every DIPFIT command (multifit, gridsearch, leadfield, settings); pop_dipfit_gridsearch.py:61-68,100-103 writes typed grids as quoted strings and default grids as expanded literal arrays (F114).
  • Fix: EEGLAB-form history for all DIPFIT commands (grids as linspace(-85,85,24)); dipplot over standard_mri slices with Plot one/Next/Prev (item 20).
  • Runnable history for every DIPFIT command

20. DIPFIT > Component dipole plot: background picker disabled, plain scatter (MINOR, low)

  • eegprep now: same rows and defaults; background ... disabled (src/eegprep/plugins/dipfit/pop_dipplot.py:98); plot is a matplotlib 3-D scatter.
  • EEGLAB: pop_dipplot.m / dipplot.m: three MRI slices with dipoles, navigation, background image picker.
  • Fix: enable the picker; draw dipoles over the template MRI slices with navigation.
  • MRI-slice plot and picker

21. DIPFIT > Distributed source Leadfield matrix: history (PASS with follow-up)

  • Leadfield computed and stored (F116 fixed); history EEG = pop_leadfield(EEG, sourcemodel=loreta-key, downsample=4). Fix: EEGLAB form via item 19.
  • MATLAB-form history

22. Shared: dialogs close on validation errors

  • Seen in File > Import data > From ASCII (Ok with no file), File > Import event info > From MATLAB array (wrong box), Edit > Dataset info (srate abc): the error is clear but the dialog closes and the user re-enters everything.
  • Fix: in the shared inputgui path, show the error and keep the dialog open with the typed values when the pop function raises a validation error (ValueError), closing only on success or Cancel; phrase hints in GUI terms (e.g. "Input field names", "Number of header lines").
  • Test: renderer test that a raising validator leaves the dialog open with values intact.
  • Dialog stays open on validation errors

Global definition of done

  • Every checkbox above ticked, or a finding explicitly marked deferred in the PR with Suraj's agreement (items 6 and 7 at minimum disabled with a tooltip and documented)
  • GUI retest side by side with EEGLAB (pin 8ac485f6) of every Edit and Tools item above on the same datasets, screenshots attached to the PR
  • MATLAB parity on jamming for every numeric item (1, 2, 3, 4, 5, 7, 16) with scripts committed under tests/matlab/
  • Tests added for every finding; no changes to tests/fuzz/, tolerances.toml, goldens or parity JSON (only Suraj or Arno change those)
  • Where EEGLAB has a quirk (pop_select out-of-range, "Set threhsolds" label, Event values 999, merge default, F60 pop_interp t_range), eegprep does the correct thing, documents it, and a test locks it in
  • Error messages name the function and the fix; no comments that restate code or justify workarounds
  • History lines for Edit/Tools commands are runnable in EEGLAB

Activity

  1. added
    bug
    P1
    on Nov 23, 2026
  2. claude commented on Nov 23, 2026

    @claude
    Contributor

    🤖 Plan:

    Research

    The issue has 22 findings across about 20 modules (DIPFIT, firfilt, ICLabel, popfunc, the Qt renderer). It also needs MATLAB parity runs on jamming and a side-by-side GUI retest. Several items are feature ports, not bug fixes: eLORETA, the MRI head model, a clickable pop_selectcomps, and dipplot on MRI slices. One PR would run to several thousand lines and could not be reviewed. The five root causes I checked match the issue text.

    Relevant code (checked)

    Proposed Fix

    Split the work into separate PRs that each say Part of #675. Ordered by severity, then size:

    1. Small bug fixes (one PR, each fix under ~40 lines plus a test):
      • item 2: store posxyz/momxyz as (ndip,3) arrays in gridsearch and multifit, and read them with reshape(-1,3)
      • item 3: in pop_select, keep samples round(tmin*srate) to round(tmax*srate)-1 for epoched data and set xmin/xmax from the kept samples
      • item 11: pass selectionmode="multiple" in pop_rmdat
      • item 17: write the pop_icflag history as a positional matrix with NaN
      • item 10a: setAutoDefault(False) on body pushbuttons in qt.py:244
    2. firpmord port (item 4): port firpmord/remlpord so the function returns ceil(L)-1, and do the even rounding in the pop_firpm Estimate callback. Add a MATLAB parity test. This changes a core function, so it needs the EEGLAB reference run.
    3. DIPFIT co-registration (items 1, 19, 21): drop the fallback transform. Refuse Ok unless there is a matrix or No Co-Reg is ticked. Wire Co-register to the existing guifunc/coregister.py, and enable pop_chansel for channels to omit. Write DIPFIT history in EEGLAB form. This changes a core function, so it needs the reference run.
    4. Dialogs stay open on errors (items 22, 8): keep inputgui open when the function raises ValueError. Then enable the pop_editset file and array rows, with errors that name the field.
    5. Missing Edit-menu dialog features (items 9, 10b, 12, 14, 18):
      • Event values: insert, delete and append, and show values with 5 significant digits
      • plot windows opened from a modal dialog show on top of it
      • pop_selectevent: confirmation prompt and field buttons
      • Windowed sinc: firws window labels, and Estimate opens pop_firwsord
      • pop_subcomp: both prompts
    6. Interactive pop_selectcomps (item 5): clickable Qt grid that opens pop_prop with ACCEPT/REJECT and writes gcompreject. Needs the visual parity loop.
    7. Docs only (item 3 out-of-range behavior, items 13, 15, 16): entries in eeglab_migration.rst plus spec tests. Report the seeded F69 re-run separately.
    8. Deferred, decision needed (items 6, 7, 20): the MRI head model and eLORETA ports are large. The minimum is a disabled menu item with a tooltip and a migration note. dipplot on MRI slices is its own feature.

    Open questions for maintainers (Suraj/Arno):

    • Do you approve this split, or prefer fewer, larger PRs?
    • Items 6 and 7: port now, or disable and document for this round?
    • Item 5: is the full pop_prop ACCEPT/REJECT flow required, or can the existing ICLabel pop_viewprops path serve until then?

    I can start group 1 right away once the split is approved.

  3. added a commit that references this issue on Nov 24, 2026
  4. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    Collaborator

    🤖 The Linux geometry follow-up for the Parks–McClellan Estimate dialog is tracked in #891.

  5. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    Collaborator

    🤖 The pop_subcomp dialog and native jamming captures are tracked in #936.

  6. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    Collaborator

    🤖 The pop_dipfit_headmodel dialog and native jamming captures are tracked in #998.

  7. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    Collaborator

    🤖 The pop_dipfit_settings dialog and native jamming captures are tracked in #1002.

  8. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    Collaborator

    🤖 The pop_dipfit_nonlinear dialog and native jamming captures are tracked in #1004.

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

    P1bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions