- mne.preprocessing.annotate_break(raw, events=None, min_break_duration=15.0, t_start_after_previous=5.0, t_stop_before_next=5.0, ignore=('bad', 'edge'), *, verbose=None)#
Annotationsfor breaks in an ongoing recording.
This function first searches for segments in the data that are not annotated or do not contain any events and are at least
min_break_durationseconds long, and then proceeds to creating annotations for those break periods.
- rawinstance of
The continuous data to analyze.
array, shape (n_events, 3)
None(default), operate based solely on the annotations present in
raw. If an events array, ignore any annotations in the raw data, and operate based on these events only.
The minimum time span in seconds between the offset of one and the onset of the subsequent annotation (if
None) or between two consecutive events (if
eventsis an array) to consider this period a “break”. Defaults to 15 seconds.
This value defines the minimum duration of a break period in the data, not the minimum duration of the generated annotations! See also
- t_start_after_previous, t_stop_before_next
Specifies how far the to-be-created “break” annotation extends towards the two annotations or events spanning the break. This can be used to ensure e.g. that the break annotation doesn’t start and end immediately with a stimulation event. If, for example, your data contains a break of 30 seconds between two stimuli, and
t_start_after_previousis set to
t_stop_before_nextis set to
3, the break annotation will start 5 seconds after the first stimulus, and end 3 seconds before the second stimulus, yielding an annotated break of
30 - 5 - 3 = 22seconds. Both default to 5 seconds.
The beginning and the end of the recording will be annotated as breaks, too, if the period from recording start until the first annotation or event (or from last annotation or event until recording end) is at least
- ignoreiterable of
Annotation descriptions starting with these strings will be ignored by the break-finding algorithm. The string comparison is case-insensitive, i.e.,
('BAD',)are equivalent. By default, all annotation descriptions starting with “bad” and annotations indicating “edges” (produced by data concatenation) will be ignored. Pass an empty list or tuple to take all existing annotations into account. If
eventsis passed, this parameter has no effect.
- verbosebool |
- rawinstance of
New in version 0.24.