mne.event.define_target_events#
- mne.event.define_target_events(events, reference_id, target_id, sfreq, tmin, tmax, new_id=None, fill_na=None)[source]#
Define new events by co-occurrence of existing events.
This function can be used to evaluate events depending on the temporal lag to another event. For example, this can be used to analyze evoked responses which were followed by a button press within a defined time window.
- Parameters
- events
ndarray Array as returned by mne.find_events.
- reference_id
int The reference event. The event defining the epoch of interest.
- target_id
int The target event. The event co-occurring in within a certain time window around the reference event.
- sfreq
float The sampling frequency of the data.
- tmin
float The lower limit in seconds from the target event.
- tmax
float The upper limit border in seconds from the target event.
- new_id
int New ID for the new event.
- fill_na
int|None Fill event to be inserted if target is not available within the time window specified. If None, the ‘null’ events will be dropped.
- events
- Returns
Examples using mne.event.define_target_events#
Define target events based on time lag, plot evoked response
Plot single trial activity, grouped by ROI and sorted by RT