mne.read_annotations

mne.read_annotations(fname, sfreq='auto', uint16_codec=None)[source]

Read annotations from a file.

This function reads a .fif, .fif.gz, .vrmk, .edf, .txt, .csv or .set file and makes an mne.Annotations object.

Parameters:
fname : str

The filename.

sfreq : float | ‘auto’

The sampling frequency in the file. This parameter is necessary for *.vmrk files as Annotations are expressed in seconds and *.vmrk files are in samples. For any other file format, sfreq is omitted. If set to ‘auto’ then the sfreq is taken from the *.vhdr file that has the same name (without file extension). So data.vrmk looks for sfreq in data.vhdr.

uint16_codec : str | None

This parameter is only used in EEGLAB (*.set) and omitted otherwise. If your *.set file contains non-ascii characters, sometimes reading it may fail and give rise to error message stating that “buffer is too small”. uint16_codec allows to specify what codec (for example: ‘latin1’ or ‘utf-8’) should be used when reading character arrays and can therefore help you solve this problem.

Returns:
annot : instance of Annotations | None

The annotations.