eelbrain.load.fiff.events¶
-
eelbrain.load.fiff.
events
(raw=None, merge=None, proj=False, name=None, bads=None, stim_channel=None, events=None, annotations=None, **kwargs)¶ Load events from a raw fiff file.
Parameters: - raw : str(path) | None | mne Raw
The raw fiff file from which to extract events (if raw and events are both
None
, a file dialog will be displayed to select a raw file).- merge : int
Merge steps occurring in neighboring samples. The integer value indicates over how many samples events should be merged, and the sign indicates in which direction they should be merged (negative means towards the earlier event, positive towards the later event). By default, this parameter is inferred from the data.
- proj : bool | str
Path to the projections file that will be loaded with the raw file.
'{raw}'
will be expanded to the raw file’s path minus extension. Withproj=True
,'{raw}_*proj.fif'
will be used, looking for any projection file starting with the raw file’s name. If multiple files match the pattern, a ValueError will be raised.- name : str | None
A name for the Dataset. If
None
, the raw filename will be used.- bads : None | list
Specify additional bad channels in the raw data file (these are added to the ones that are already defined in the raw file).
- stim_channel : None | string | list of string
Name of the stim channel or all the stim channels affected by the trigger. If None, the config variables ‘MNE_STIM_CHANNEL’, ‘MNE_STIM_CHANNEL_1’, ‘MNE_STIM_CHANNEL_2’, etc. are read. If these are not found, it will default to ‘STI 014’.
- events : None | str
If events are stored in a fiff file separate from the Raw object, the path to the events file can be supplied here. The events in the Dataset will reflect the event sin the events file rather than the raw file.
- annotations : bool
Generate events from annotations instead of the stim channel (by default, annotations are used when present).
- **
Keyword arguments for loading the raw file (see
mne.io.read_raw_kit()
ormne.io.read_raw_kit()
).
Returns: - events : Dataset
- A Dataset with the following variables:
- i_start: the index of the event in the raw file.
- trigger: the event value.
- The Dataset’s info dictionary contains the following values:
- raw: the mne Raw object.