eegprep.pop_epoch#

eegprep.pop_epoch(EEG, types=None, lim=None, **kwargs)#

Convert a continuous EEG dataset to epoched data by extracting data epochs time locked to specified event types or event indices.

May also sub-epoch an already epoched dataset.

Python translation of EEGLAB’s pop_epoch function.

Usage:

EEG_out = pop_epoch(EEG) # GUI mode not supported EEG_out = pop_epoch(EEG, types, timelimits) EEG_out, indices = pop_epoch(EEG, types, timelimits, **kwargs)

Inputs:

EEG - Input EEG dataset (dict). Data may already be epoched. types - String (regular expression) or list of event types to time

lock to. Default is [] which means to extract epochs locked to every single event.

lim - Epoch latency limits [start end] in seconds relative to

the time-locking event. Default: [-1, 2]

Optional keyword arguments:

eventindices - List of event indices to use for epoching (0-based) timeunit - ‘seconds’ or ‘points’. Default: ‘points’ newname - Name for the new dataset valuelim - Rejection limits [min max]. Default: [-Inf, Inf] epochinfo - ‘yes’ or ‘no’. Default: ‘yes’

Outputs:

EEG_out - Output epoched dataset indices - Indices of accepted epochs (0-based)

Note: This function calls the epoch() function to do the actual epoching.