eeg_time2prev#

eeg_time2prev(EEG, target, previous)#

Return delays from target events to preceding original events.

Event and urevent pointers in EEGPrep dictionaries are zero-based. Returned targets, urtargets, and urprevs therefore use zero-based indices; urprevs uses -1 when no matching preceding event exists. Event latencies remain EEGLAB-compatible one-based sample positions.

Parameters:
  • EEG (dict[str, Any]) – Dataset containing event, urevent, and srate.

  • target (Sequence[Any]) – Event types whose delays should be reported.

  • previous (Sequence[Any]) – Event types eligible as the preceding event.

Returns:

(delays_ms, targets, urtargets, urprevs).

Return type:

tuple[ndarray, ndarray, ndarray, ndarray]