Skip to content

Phase 6: ICLabel, viewprops, and visual diagnostics completion #163

Closed

Description

@suraj-ranganath

🤖 Phase 6 completes ICLabel/viewprops and visual diagnostic workflows.

Summary

Round out ICLabel and viewprops as polished EEGPrep diagnostic tools: label statistics, component/channel property displays, scroll/ERP/spectrum/topography panels, network artifact decisions, and GUI parity for researchers inspecting components.

Scope

  • Implement or classify eeg_icalabelstat and related ICLabel summary/statistics behavior.
  • Complete viewprops/property display parity where EEGPrep currently uses simplified native replacements.
  • Decide whether alternate ICLabel network artifacts are in scope; if not, document the supported packaged network clearly.
  • Ensure pop_viewprops, pop_prop_extended, ICLabel outputs, and browser-backed component workflows are visually useful and EEGLAB-familiar.
  • Add docs and help resources for ICLabel/viewprops workflows.

Acceptance Criteria

  • Component diagnostic workflows are usable from GUI and console and match EEGLAB layout/labels/defaults where practical.
  • ICLabel statistics match EEGLAB/MATLAB parity expectations where deterministic.
  • Missing optional networks fail clearly or are documented as unsupported.
  • Side-by-side visual parity evidence covers the main component-property flows.
  • Tests cover sample data with ICA/ICLabel state, empty/missing ICA errors, history, and GUI/session sync.

Required References

  • AGENTS.md
  • src/eegprep/eeglab/plugins/ICLabel/
  • src/eegprep/eeglab/plugins/ICLabel/viewprops/
  • src/eegprep/plugins/ICLabel/
  • .agents/skills/eegprep-feature-development/SKILL.md
  • .agents/skills/eeglab-gui-visual-parity/SKILL.md
  • .agents/skills/gui-agent-flow-qa/SKILL.md

/goal

/goal Complete EEGPrep ICLabel/viewprops diagnostic parity for the final standalone epic. Inspect EEGLAB ICLabel and viewprops source, implement label statistics and practical component/property displays with native EEGPrep GUI behavior, preserve console/history/session sync, add MATLAB parity where deterministic, sample_data ICA/ICLabel integration tests, side-by-side visual evidence, docs/help resources, ruff/format/ty, non-slow pytest, and pre-commit. Keep unsupported alternate network artifacts explicit rather than silently ignored.

Activity

  1. added
    phase
    on Jun 7, 2026
  2. claude commented on Jun 7, 2026

    @claude
    Contributor

    🤖 Plan:

    • Read AGENTS.md, fix-issue, pull-request skills
    • Duplicate-work preflight (open PRs/issues)
    • Inventory current ICLabel/viewprops modules, tests, visual parity, menu wiring
    • Identify concrete gaps vs. acceptance criteria
    • Human review of proposed scope/approach before implementation begins

    Scope assessment

    Phase 6 epic. Touches src/eegprep/plugins/ICLabel/, viewprops/property-display flows, console/session sync, MATLAB parity, docs, and visual parity. Multi-module and well over 100 LOC — per the fix-issue routing rules I am posting analysis instead of opening a PR.

    Research

    Current ICLabel surface is largely in place; remaining work is statistics, network-artifact decisions, and parity evidence, not greenfield porting.

    Already implemented (sizes in src/eegprep/plugins/ICLabel/):

    • pop_iclabel.py (79) — exposes default|lite|beta strings; Python path ignores them and always loads netICL.mat. Only matlab/octave engine actually switches networks.
    • pop_icflag.py (164), eeg_icflag.py (63) — flagging + threshold dialog.
    • pop_viewprops.py (207) — chan/comp thumbnail overview + activity browser; dialog spec wired.
    • pop_prop_extended.py (1376) — dashboard with topo / activity / ERPimage / spectrum / class probs / DIPFIT slices / accept/reject buttons.
    • iclabel.py (106), iclabel_net.py (266), ICL_feature_extractor.py (105), eeg_rpsd.py, eeg_autocorr*.py.
    • Menu/console wiring: menu_placeholders.py lines 81-82, 128; menu_actions.py lines 1129-1283 (pop_iclabel/pop_icflag/pop_viewprops auto-run + history).
    • Tests: tests/test_iclabel.py (71), test_iclabel_features.py (179), test_pop_prop_extended.py (182), test_gui_pop_iclabel.py (61), test_gui_pop_prop_extended.py (277), tests/compare_iclabel_engines.py.
    • Visual parity cases already present in tools/visual_parity/cases.json: pop_iclabel_dialog (L1945), pop_icflag_dialog (L1970), pop_viewprops_dialog (L2160), iclabel_pop_prop_extended_dashboard (L2174).
    • Help resources: src/eegprep/resources/help/pop_viewprops.md, pop_prop_extended.md.

    Open gaps explicitly named by the audit (.notes/eeglab-migration-gap-audit.md L350-357):

    • eeg_icalabelstat — not implemented or referenced anywhere (verified by grep).
    • MatConvNet runtime/tooling parity — N/A for standalone Python; needs an explicit non-goal note.
    • Alternate ICLabel network artifacts (lite, beta) — advertised in pop_iclabel.py L12, L34-36 but the Python branch (iclabel.py L57-99) silently ignores algorithm and always loads netICL.mat. Either bundle the alternate weights, route lite/beta to a clear NotImplementedError for engine=None, or remove them from the choice set.
    • "Exact MATLAB viewprops helper parity where EEGPrep uses native Python/Qt replacements" — needs case-by-case classification, not blind ports.

    Relevant code

    • src/eegprep/plugins/ICLabel/pop_iclabel.py#L12-L42 — advertised vs. honored icversion set
    • src/eegprep/plugins/ICLabel/iclabel.py#L57-L99 — Python branch ignores algorithm
    • src/eegprep/plugins/ICLabel/pop_viewprops.py#L29-L75 — chanorcomp/spec/erp/scroll flow
    • src/eegprep/plugins/ICLabel/pop_prop_extended.py#L1-L120 — dashboard data model
    • src/eegprep/functions/guifunc/menu_actions.py#L1129-L1283 — GUI/console wiring
    • .notes/eeglab-migration-gap-audit.md#L340-L357 — declared remaining gaps

    Proposed approach

    Decompose into four small PRs against the epic branch feature/eeglab-full-standalone-completion. Each can be reviewed independently.

    1. eeg_icalabelstat port + integration. Implement src/eegprep/plugins/ICLabel/eeg_icalabelstat.py returning per-class component counts, mean probability, and flagged-vs-kept tallies from EEG.etc.ic_classification.ICLabel.classifications and EEG.reject.gcompreject. Mirror the MATLAB return signature using a dict with EEGLAB-named keys. Add a console-friendly summary print path. Tests: deterministic input → known counts; missing classification → clear error; sample-data integration with ICA + ICLabel applied. MATLAB parity test gated by EEGPREP_SKIP_MATLAB. Help: src/eegprep/resources/help/eeg_icalabelstat.md. ~150-250 LOC + tests.

    2. Alternate network decision. Decide between (a) bundling netICL_lite.mat / netICL_beta.mat, or (b) restricting pop_iclabel Python engine to default and raising a clear NotImplementedError for lite|beta unless engine in {"matlab","octave"}. Default recommendation: (b) — matches "fail clearly or document as unsupported" in the acceptance criteria. Update dialog spec, help text, parity matrix row. Tests: explicit error when engine=None, icversion="lite"; matlab path still accepts all three (skipped without MATLAB). ~50 LOC + tests.

    3. viewprops/prop_extended visual parity completion. Run the four existing cases.json cases through tools/visual_parity/capture.py + compare.py, attach side-by-side images to the phase PR via gh attach --comment, and tune layout/labels/control order where diffs are large. Document any MATLAB-only widgets deliberately replaced with native Qt as classified gaps in .notes/eeglab-migration-gap-audit.md. No production-code churn unless a parity diff requires it.

    4. Docs + closeout. Add a "Component diagnostics" section to the Sphinx user guide describing pop_iclabel → pop_icflag → pop_viewprops → pop_prop_extended → eeg_icalabelstat as one workflow, with the unsupported-network policy stated. Update parity matrix entries for ICLabel rows. Run ./pre-commit.py --fix, EEGPREP_SKIP_MATLAB=1 uv run pytest -m "not slow", and the visual parity suite before opening the phase PR.

    Open questions for human review

    1. Alternate networks (lite, beta) — bundle weights or fail clearly? Recommendation: fail clearly; bundling adds ~30-60 MB resources most users will not need.
    2. eeg_icalabelstat return shape — match EEGLAB struct fields exactly (e.g. class_count, class_probmean) or use a Python dataclass? Recommendation: dict with EEGLAB-named keys for console parity.
    3. "Visual diagnostic workflows" scope — pop_prop_extended already covers scroll/ERP/spectrum/topography. Confirm no additional standalone diagnostic dialogs (e.g. separate pop_specview) are in-scope for this phase.

    Will not start coding until at least Q1 and Q2 are answered.

  3. suraj-ranganath commented on Jun 7, 2026

    @suraj-ranganath
    MemberAuthor

    🤖 # Research

    No open PR currently overlaps #163. EEGPrep already has native pop_iclabel, pop_icflag, pop_viewprops, and pop_prop_extended surfaces; the remaining Phase 6 gaps are the missing eeg_icalabelstat public helper, standalone Python lite/beta ICLabel network requests being silently treated as default, and final docs/matrix/evidence for the viewprops diagnostic workflow.

    Relevant code

    • src/eegprep/eeglab/plugins/ICLabel/eeg_icalabelstat.m - MATLAB stats oracle
    • src/eegprep/plugins/ICLabel/iclabel.py - Python network loading policy
    • src/eegprep/plugins/ICLabel/pop_iclabel.py - version dialog/history
    • src/eegprep/plugins/ICLabel/pop_viewprops.py - overview/browser workflow
    • src/eegprep/plugins/ICLabel/pop_prop_extended.py - diagnostic dashboard

    Proposed Fix

    Implement eeg_icalabelstat as an EEGPrep-owned public helper that preserves EEGLAB threshold counts and prints the familiar class summary while returning structured Python statistics. Make standalone Python ICLabel accept only the packaged default netICL.mat; lite and beta remain explicit MATLAB/Octave passthrough choices and raise a clear standalone limitation. Update focused tests, sample-data ICLabel-state coverage, help/API/user-guide docs, final parity matrix rows, implementation notes, and visual parity evidence before opening a PR to feature/eeglab-full-standalone-completion with Closes #163.

  4. suraj-ranganath commented on Jun 7, 2026

    @suraj-ranganath
    MemberAuthor

    🤖 Implemented in PR #167: #167

    Added standalone eeg_icalabelstat, explicit default-only Python ICLabel network handling, ICLabel/viewprops docs/help, final parity matrix closeout, focused sample-data and GUI tests, Computer Use GUI flow QA, and attached visual parity evidence to the PR. Local verification passed: focused ICLabel/viewprops tests, final matrix validator, visual parity metadata tests, docs build, ruff, format, ty, staged pre-commit, and EEGPREP_SKIP_MATLAB=1 uv run --no-sync pytest -m "not slow". PR check Claude PR Review / review completed successfully.

  5. suraj-ranganath commented on Jun 7, 2026

    @suraj-ranganath
    MemberAuthor

    🤖 Phase PR for this issue has merged into feature/eeglab-full-standalone-completion and integration checks are passing on the epic branch. Closing this phase issue as completed.

  6. arnodelorme commented on Dec 1, 2026

    @arnodelorme
    Collaborator

    🤖 The pop_viewprops dialog and native jamming captures are tracked in #961.

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

    phase

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions