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
Phase 4: Plotting, topographies, time-frequency, and statistics #64
Complete Plot-menu parity plus missing low-level plotting, topography, time-frequency, cross-coherence, and statistics functions.
Target branch and PR flow
Create the phase branch from feature/eeglab-completion.
Open the phase PR back into feature/eeglab-completion.
The phase PR should close this issue.
Parallelization
Can run in parallel with Phases 1 and 2. Component-specific plot integration should coordinate with Phase 3.
In scope
Topoplot wrappers and channel/component property views.
Channel/component spectra and maps.
ERP images, ERPs, scalp arrays, map series, and related plotting wrappers.
Time-frequency transforms and cross-coherence.
Event, channel, and component statistics.
Supporting signal/stat/time-frequency helpers needed for these workflows.
Headless-safe plotting tests where feasible.
Out of scope
EEGBrowser/eegplot scrolling viewers.
Acceptance criteria
Plot menu actions produce usable matplotlib/Qt outputs with EEGLAB-compatible inputs, labels, defaults, and history.
Time-frequency/statistical outputs have MATLAB parity tests for deterministic numerical pieces and documented tolerances for known floating-point differences.
GUI visual parity exists for each interactive plotting/options dialog.
Plotting functions work headlessly in CI where possible and degrade clearly when a display is required.
Browser/scrolling plot actions remain excluded if they require EEGBrowser.
Required lint/type/test commands pass.
/goal prompt
/goal Complete EEGPrep parity for Plot-menu, topography, ERP, spectra, time-frequency, cross-coherence, and statistics workflows, excluding EEGBrowser scrolling viewers. Use EEGLAB source and sample_data to define behavior, implement standalone Python outputs, add MATLAB parity and headless plotting tests, add visual parity for dialogs, verify console/GUI history behavior, and keep ruff/format/ty plus relevant pytest suites green.
Read issue and skills, run duplicate-work preflight (no open PRs/issues overlap)
Scope check: epic phase ticket spanning 15+ pop functions, low-level helpers, GUI dialogs, MATLAB parity, headless tests, help docs — too large for a single PR
Inventory current state vs. Plot menu wiring
Post research + proposed approach for human review
Await scoping decision before opening implementation PR(s)
Research
Phase 4 is an epic umbrella ticket. The Plot menu in src/eegprep/functions/guifunc/eeglab_menu.py#L218-L307 already wires every action, but every Phase 4 pop_* is a NotImplementedError placeholder in src/eegprep/functions/guifunc/menu_placeholders.py#L13-L72 (pop_chanplot, pop_comperp, pop_envtopo, pop_erpimage, pop_eventstat, pop_headplot, pop_newcrossf, pop_newtimef, pop_plotdata, pop_plottopo, pop_prop, pop_signalstat, pop_spectopo, pop_timtopo, pop_topoplot). Low-level support is similarly thin: src/eegprep/functions/sigprocfunc/ contains only topoplot.py, cart2topo.py, epoch.py, eegrej.py, reref.py, runica.py, runamica.py — no spectopo, timef, crossf, erpimage, signalstat, eventstat helpers. No timefreqfunc/ or statistics/ directories exist. Vendored EEGLAB reference dir at src/eegprep/eeglab/ is empty in the worktree so parity work needs it populated locally first.
Relevant code
src/eegprep/functions/guifunc/eeglab_menu.py#L218-L307 — Plot menu wiring; actions ready, handlers missing
src/eegprep/functions/guifunc/menu_placeholders.py#L13-L72 — every Phase 4 pop is a coming-soon stub
src/eegprep/functions/sigprocfunc/ — only topoplot/cart2topo present; no spectopo/timef/crossf/erpimage
src/eegprep/resources/help/ — no help markdown yet for any Phase 4 function
src/eegprep/eeglab/ — vendored reference dir empty; parity work needs it populated locally
Proposed Approach
Epic-scoped design change; one PR violates the >100-line guidance and AGENTS.md "smallest change that solves the request." Recommend splitting into ~8 component PRs against feature/eeglab-completion, each scoped to one pop wrapper + low-level helper(s) + tests + help md, sized 200–600 LOC. Suggested ordering and bundling:
pop_prop + pop_chanplot — properties dialog (reuses topoplot+spectopo+erpimage) and STUDY channel measures plot.
Each component PR follows the eeglab-gui-visual-parity skill for the dialog, the eegprep-feature-development skill end-to-end, adds resources/help/<name>.md, replaces the matching entry in menu_placeholders.py, and adds headless plotting tests (Agg backend) plus MATLAB parity tests for deterministic numerical pieces.
Open questions before implementation
Confirm 8-component breakdown above, or prefer finer/coarser grouping (e.g. one PR per pop_*)?
Acceptable tolerance for time-frequency parity (newtimef/newcrossf inherit FFT/wavelet windowing differences vs MATLAB)? Suggest 1e-6 absolute on power, 1e-4 on phase, documented per test.
Should pop_headplot ship without the MATLAB MESH/SPLINE bundled head model, or is fetching/regenerating that mesh in-scope for Phase 4?
Browser/scrolling viewers (pop_eegplot) are out of scope — confirm pop_erpimage interactive features that rely on eegplot callbacks (e.g. trial scroll) can render statically without those callbacks?
STUDY-dependent pop_chanplot — does this depend on Phase 5 STUDY workflows, or is the standalone channel-measure plot path in-scope here?
Visual parity baseline images — generate against the vendored MATLAB EEGLAB build per skill, or accept screenshots from the EEGLAB sccn build the maintainers run?
Awaiting decisions on Q1–Q6 before opening the first component PR.
Activity
claude commentedon May 27, 2026
🤖 Plan:
Research
Phase 4 is an epic umbrella ticket. The Plot menu in
src/eegprep/functions/guifunc/eeglab_menu.py#L218-L307already wires every action, but every Phase 4pop_*is a NotImplementedError placeholder insrc/eegprep/functions/guifunc/menu_placeholders.py#L13-L72(pop_chanplot, pop_comperp, pop_envtopo, pop_erpimage, pop_eventstat, pop_headplot, pop_newcrossf, pop_newtimef, pop_plotdata, pop_plottopo, pop_prop, pop_signalstat, pop_spectopo, pop_timtopo, pop_topoplot). Low-level support is similarly thin:src/eegprep/functions/sigprocfunc/contains onlytopoplot.py,cart2topo.py,epoch.py,eegrej.py,reref.py,runica.py,runamica.py— no spectopo, timef, crossf, erpimage, signalstat, eventstat helpers. Notimefreqfunc/orstatistics/directories exist. Vendored EEGLAB reference dir atsrc/eegprep/eeglab/is empty in the worktree so parity work needs it populated locally first.Relevant code
src/eegprep/functions/guifunc/eeglab_menu.py#L218-L307— Plot menu wiring; actions ready, handlers missingsrc/eegprep/functions/guifunc/menu_placeholders.py#L13-L72— every Phase 4 pop is a coming-soon stubsrc/eegprep/functions/sigprocfunc/— only topoplot/cart2topo present; no spectopo/timef/crossf/erpimagesrc/eegprep/resources/help/— no help markdown yet for any Phase 4 functionsrc/eegprep/eeglab/— vendored reference dir empty; parity work needs it populated locallyProposed Approach
Epic-scoped design change; one PR violates the >100-line guidance and AGENTS.md "smallest change that solves the request." Recommend splitting into ~8 component PRs against
feature/eeglab-completion, each scoped to one pop wrapper + low-level helper(s) + tests + help md, sized 200–600 LOC. Suggested ordering and bundling:pop_topoplot+pop_headplot— 2-D/3-D map series; reusessigprocfunc/topoplot.py; addheadplot.py.pop_spectopo— channel/component spectra+maps; portssigprocfunc/spectopoand pwelch plumbing.pop_erpimage— ERP image; portssigprocfunc/erpimagecore plus sort/align utilities.pop_timtopo+pop_plottopo+pop_plotdata— channel ERPs with maps / array / rect.pop_envtopo+pop_comperp— component ERP envelopes and ERP comparisons.pop_newtimef+pop_newcrossf— newfunctions/timefreqfunc/(timef, crossf, newtimef, newcrossf, timewarp helpers); deterministic-numerics MATLAB parity with documented tolerances.pop_signalstat+pop_eventstat—functions/statistics/(signalstat, eventstat); MATLAB parity for moments/distributions.pop_prop+pop_chanplot— properties dialog (reuses topoplot+spectopo+erpimage) and STUDY channel measures plot.Each component PR follows the eeglab-gui-visual-parity skill for the dialog, the eegprep-feature-development skill end-to-end, adds
resources/help/<name>.md, replaces the matching entry inmenu_placeholders.py, and adds headless plotting tests (Agg backend) plus MATLAB parity tests for deterministic numerical pieces.Open questions before implementation
pop_*)?pop_headplotship without the MATLAB MESH/SPLINE bundled head model, or is fetching/regenerating that mesh in-scope for Phase 4?pop_erpimageinteractive features that rely oneegplotcallbacks (e.g. trial scroll) can render statically without those callbacks?pop_chanplot— does this depend on Phase 5 STUDY workflows, or is the standalone channel-measure plot path in-scope here?Awaiting decisions on Q1–Q6 before opening the first component PR.