eeg_icflag#

eeg_icflag(EEG, thresholds)#

Flag independent components based on ICLabel classification probabilities.

Parameters#

EEGdict

EEG structure with ICLabel classifications in EEG[‘etc’][‘ic_classification’][‘ICLabel’][‘classifications’]

thresholdsarray-like, shape (7, 2)

Threshold matrix where each row corresponds to an IC class: [Brain, Muscle, Eye, Heart, Line Noise, Channel Noise, Other] Each row contains [min_threshold, max_threshold]. Use NaN in either column to ignore a class, matching EEGLAB’s blank threshold fields.

Returns#

EEGdict

EEG structure with added ‘reject’ field containing flags for each component

Examples#

# Flag components with Muscle > 0.9 OR Eye > 0.9 thresholds = np.array([

[np.nan, np.nan], # Brain [0.9, 1.0], # Muscle [0.9, 1.0], # Eye [np.nan, np.nan], # Heart [np.nan, np.nan], # Line Noise [np.nan, np.nan], # Channel Noise [np.nan, np.nan], # Other

]) EEG = eeg_icflag(EEG, thresholds)