mne.
Annotations
(onset, duration, description, orig_time=None)¶Annotation object for annotating segments of raw data.
Annotations are added to instance of mne.io.Raw
as an attribute
named annotations
. See the example below. To reject bad epochs using
annotations, use annotation description starting with ‘bad’ keyword. The
epochs with overlapping bad segments are then rejected automatically by
default.
>>> eog_events = mne.preprocessing.find_eog_events(raw)
>>> n_blinks = len(eog_events)
>>> onset = eog_events[:, 0] / raw.info['sfreq'] - 0.25
>>> duration = np.repeat(0.5, n_blinks)
>>> description = ['bad blink'] * n_blinks
>>> annotations = mne.Annotations(onset, duration, description)
>>> raw.annotations = annotations
>>> epochs = mne.Epochs(raw, events, event_id, tmin, tmax)
Parameters: | onset : array of float, shape (n_annotations,)
duration : array of float, shape (n_annotations,)
description : array of str, shape (n_annotations,) | str
orig_time : float | int | instance of datetime | array of int | None
|
---|
Notes
If orig_time
is None, the annotations are synced to the start of the
data (0 seconds). Otherwise the annotations are synced to sample 0 and
raw.first_samp
is taken into account the same way as with events.
Methods
__hash__ () <==> hash(x) |
__hash__
() <==> hash(x)¶