mne.
Annotations
(onset, duration, description, orig_time=None)[source]¶Annotation object for annotating segments of raw data.
Annotations are added to instance of mne.io.Raw
as an attribute
named annotations
. 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.
To remove epochs with blinks you can do:
>>> 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) |
|
__len__ () |
Return the number of annotations. |
append (onset, duration, description) |
Add an annotated segment. |
delete (idx) |
Remove an annotation. |
__hash__
() <==> hash(x)¶append
(onset, duration, description)[source]¶Add an annotated segment. Operates inplace.
Parameters: | onset : float
duration : float
description : str
|
---|