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: |
|
---|
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
__add__ (other) |
Add (concatencate) two Annotation objects. |
__hash__ ($self, /) |
Return hash(self). |
__len__ () |
Return the number of annotations. |
append (onset, duration, description) |
Add an annotated segment. |
copy () |
Return a deep copy of self. |
delete (idx) |
Remove an annotation. |
save (fname) |
Save annotations to FIF. |
__hash__
($self, /)¶Return hash(self).
append
(onset, duration, description)[source]¶Add an annotated segment. Operates inplace.
Parameters: |
|
---|---|
Returns: |
|