Skip to content

eegprep-lean: set channel types from the Zarr group's channel_type #668

Done

Description

@neuromechanist

When eegprep-lean loads a recording from a NEMAR Zarr serving copy, to_eeg sets no channel types, so a non-EEG channel stored in the EEG group (for example ECG) is treated as a signal channel. Downstream, nemar-process's nemar-ica decomposes it with the EEG and ICLabel returns a heart component built from the ECG lead itself.

Request: read each channel's type from the group's channel_type metadata and set it in the EEG structure (EEG.chanlocs.type), so callers that select EEG channels by type exclude ECG, EOG and others as they do on the BIDS path.

Context: nemarOrg/nemar-process#81 (nemar-ica on the Zarr serving copy), epic nemarOrg/nemar-cli#2324. nemar-process will re-pin eegprep-lean once a commit holds the fix.

Activity

  1. claude commented on Nov 23, 2026

    @claude
    Contributor

    🤖 Plan:

    Research: GroupMetadata already parsed channel_type (packages/eegprep-lean/src/eegprep_lean/channels.py), but read_window copied only labels and unit into Window, and to_eeg built chanlocs without type.

    Fix: types are set only when every channel in the window declares one, which matches how labels work.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions