MCPcopy
hub / github.com/mne-tools/mne-python / Annotations

Class Annotations

mne/annotations.py:219–946  ·  view source on GitHub ↗

Annotation object for annotating segments of raw data. .. note:: To convert events to `~mne.Annotations`, use `~mne.annotations_from_events`. To convert existing `~mne.Annotations` to events, use `~mne.events_from_annotations`. Parameters ---------- onset : ar

Source from the content-addressed store, hash-verified

217
218@fill_doc
219class Annotations:
220 """Annotation object for annotating segments of raw data.
221
222 .. note::
223 To convert events to `~mne.Annotations`, use
224 `~mne.annotations_from_events`. To convert existing `~mne.Annotations`
225 to events, use `~mne.events_from_annotations`.
226
227 Parameters
228 ----------
229 onset : array of float, shape (n_annotations,)
230 The starting time of annotations in seconds after ``orig_time``.
231 duration : array of float, shape (n_annotations,) | float
232 Durations of the annotations in seconds. If a float, all the
233 annotations are given the same duration.
234 description : array of str, shape (n_annotations,) | str
235 Array of strings containing description for each annotation. If a
236 string, all the annotations are given the same description. To reject
237 epochs, use description starting with keyword 'bad'. See example above.
238 orig_time : float | str | datetime | tuple of int | None
239 A POSIX Timestamp, datetime or a tuple containing the timestamp as the
240 first element and microseconds as the second element. Determines the
241 starting time of annotation acquisition. If None (default),
242 starting time is determined from beginning of raw data acquisition.
243 In general, ``raw.info['meas_date']`` (or None) can be used for syncing
244 the annotations with raw data if their acquisition is started at the
245 same time. If it is a string, it should conform to the ISO8601 format.
246 More precisely to this '%%Y-%%m-%%d %%H:%%M:%%S.%%f' particular case of
247 the ISO8601 format where the delimiter between date and time is ' ' and at most
248 microsecond precision (nanoseconds are not supported).
249 %(ch_names_annot)s
250
251 .. versionadded:: 0.23
252 extras : list[dict[str, int | float | str | None] | None] | None
253 Optional list of dicts containing extra fields for each annotation.
254 The number of items must match the number of annotations.
255
256 .. versionadded:: 1.10
257
258 See Also
259 --------
260 mne.annotations_from_events
261 mne.events_from_annotations
262 mne.HEDAnnotations
263
264 Notes
265 -----
266 Annotations are added to instance of :class:`mne.io.Raw` as the attribute
267 :attr:`raw.annotations <mne.io.Raw.annotations>`.
268
269 To reject bad epochs using annotations, use
270 annotation description starting with 'bad' keyword. The epochs with
271 overlapping bad segments are then rejected automatically by default.
272
273 To remove epochs with blinks you can do:
274
275 >>> eog_events = mne.preprocessing.find_eog_events(raw) # doctest: +SKIP
276 >>> n_blinks = len(eog_events) # doctest: +SKIP

Callers 15

test_flat_bad_acq_skipFunction · 0.90
test_annotate_breaksFunction · 0.90
short_raw_epochsFunction · 0.90
test_realignFunction · 0.90
test_find_eogFunction · 0.90
test_anonymizeFunction · 0.90
test_split_filesFunction · 0.90
test_saveFunction · 0.90
test_annotation_cropFunction · 0.90

Calls

no outgoing calls

Tested by 15

test_flat_bad_acq_skipFunction · 0.72
test_annotate_breaksFunction · 0.72
short_raw_epochsFunction · 0.72
test_realignFunction · 0.72
test_find_eogFunction · 0.72
test_anonymizeFunction · 0.72
test_split_filesFunction · 0.72
test_saveFunction · 0.72
test_annotation_cropFunction · 0.72