mne.read_events#

mne.read_events(filename, include=None, exclude=None, mask=None, mask_type='and', return_event_id=False, verbose=None)[source]#

Read events from fif or text file.

See Parsing events from raw data and Working with events for more information about events.

Parameters:
filenamepath-like

Name of the input file. If the extension is .fif, events are read assuming the file is in FIF format, otherwise (e.g., .eve, .lst, .txt) events are read as coming from text. Note that new format event files do not contain the "time" column (used to be the second column).

includeint | list | None

A event id to include or a list of them. If None all events are included.

excludeint | list | None

A event id to exclude or a list of them. If None no event is excluded. If include is not None the exclude parameter is ignored.

maskint | None

The value of the digital mask to apply to the stim channel values. If None (default), no masking is performed.

mask_type'and' | 'not_and'

The type of operation between the mask and the trigger. Choose ‘and’ (default) for MNE-C masking behavior.

New in v0.13.

return_event_idbool

If True, event_id will be returned. This is only possible for -annot.fif files produced with MNE-C mne_browse_raw.

New in v0.20.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns:
eventsndarray of int, shape (n_events, 3)

The identity and timing of experimental events, around which the epochs were created. See events for more information.

event_iddict

Dictionary of {str: int} mappings of event IDs.

Notes

This function will discard the offset line (i.e., first line with zero event number) if it is present in a text file.

For more information on mask and mask_type, see mne.find_events().

Examples using mne.read_events#

Working with events

Working with events

Rejecting bad data spans and breaks

Rejecting bad data spans and breaks

Exporting Epochs to Pandas DataFrames

Exporting Epochs to Pandas DataFrames

EEG analysis - Event-Related Potentials (ERPs)

EEG analysis - Event-Related Potentials (ERPs)

Non-parametric between conditions cluster statistic on single trial power

Non-parametric between conditions cluster statistic on single trial power

Mass-univariate twoway repeated measures ANOVA on single trial power

Mass-univariate twoway repeated measures ANOVA on single trial power

Spatiotemporal permutation F-test on full sensor data

Spatiotemporal permutation F-test on full sensor data

Permutation t-test on source data with spatio-temporal clustering

Permutation t-test on source data with spatio-temporal clustering

Repeated measures ANOVA on source data with spatio-temporal clustering

Repeated measures ANOVA on source data with spatio-temporal clustering

Simulate raw data using subject anatomy

Simulate raw data using subject anatomy

Define target events based on time lag, plot evoked response

Define target events based on time lag, plot evoked response

XDAWN Denoising

XDAWN Denoising

Visualize channel over epochs as an image

Visualize channel over epochs as an image

Whitening evoked data with a noise covariance

Whitening evoked data with a noise covariance

Compare evoked responses for different conditions

Compare evoked responses for different conditions

Compute a cross-spectral density (CSD) matrix

Compute a cross-spectral density (CSD) matrix

Compute Power Spectral Density of inverse solution from single epochs

Compute Power Spectral Density of inverse solution from single epochs

Permutation F-test on sensor data with 1D cluster level

Permutation F-test on sensor data with 1D cluster level

FDR correction on T-test on sensor data

FDR correction on T-test on sensor data

Permutation T-test on sensor data

Permutation T-test on sensor data

Decoding source space data

Decoding source space data

Decoding sensor space data with generalization across time and conditions

Decoding sensor space data with generalization across time and conditions

Analysis of evoked response using ICA and PCA reduction techniques

Analysis of evoked response using ICA and PCA reduction techniques

XDAWN Decoding From EEG data

XDAWN Decoding From EEG data

Compute effect-matched-spatial filtering (EMS)

Compute effect-matched-spatial filtering (EMS)

Linear classifier on sensor data with plot patterns and filters

Linear classifier on sensor data with plot patterns and filters

Compute MNE-dSPM inverse solution on single epochs

Compute MNE-dSPM inverse solution on single epochs