lw_pipeline.helper.mne.add_annotation_prefix#
- lw_pipeline.helper.mne.add_annotation_prefix(annotations, prefix='BAD ', regex='(Active Stimulation)|(Buffer Stimulation)')[source]#
Add a prefix to annotation descriptions with descriptions matching a regex.
Operates in-place.
- Parameters:
annotations (mne.Annotations) – The annotations object containing the descriptions to modify.
prefix (str) – The prefix to add to the annotation descriptions.
regex (str) – The regex to match the annotation descriptions.
- Returns:
annotations – The annotations object with updated descriptions.
- Return type:
mne.Annotations