eegprep.eegrej#

eegprep.eegrej(indata, regions, timelength, events=None)#

Remove [beg end] sample ranges (1-based, inclusive) from continuous data and update events.

Parameters#

indataarray-like

2D array shaped (channels, frames)

regionsarray-like

Shape (n_regions, 2), 1-based [beg end] per row

timelengthfloat

Total duration of the original data in seconds

eventslist of dict, optional

List of dicts with at least key ‘latency’; optional keys include ‘type’ and ‘duration’. If None or empty, boundary events will still be inserted based on regions.

Returns#

outdatandarray

Data with columns removed

newtfloat

New total time in seconds

events_outlist of dict

Updated events list of dictionaries (with inserted boundaries)

boundeventsndarray

Boundary latencies (float, 1-based, with +0.5 convention)

Parameters:

events (List[Dict] | None)

Return type:

Tuple[ndarray, float, List[Dict], ndarray]