# Need some help.

**URL:** <https://mne.discourse.group/t/need-some-help/11705>\
**Category:** Support & Discussions\
**Tags:** preprocessing\
**Created:** [February 22, 2026, 7:52am UTC](https://mne.discourse.group/t/need-some-help/11705 "2026-02-22T07:52:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![1himan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/1himan/32/4697_2.png) [@1himan](https://mne.discourse.group/u/1himan)\
**Post date:** [February 22, 2026, 7:52am UTC](https://mne.discourse.group/t/need-some-help/11705/1 "2026-02-22T07:52:38Z")

</div>

```python
import mne
from mne.datasets.eyelink import data_path
from mne.preprocessing.eyetracking import read_eyelink_calibration
from mne.viz.eyetracking import plot_gaze

import mne.preprocessing.eyetracking as et

et_fpath = data_path() / "eeg-et" / "sub-01_task-plr_eyetrack.asc"
eeg_fpath = data_path() / "eeg-et" / "sub-01_task-plr_eeg.mff"

raw_et = mne.io.read_raw_eyelink(et_fpath, create_annotations=["blinks"])
raw_eeg = mne.io.read_raw_egi(eeg_fpath, events_as_annotations=True).load_data()
raw_eeg.filter(1, 30)

print(raw_et.info["chs"])
for ci, ch_info in enumerate(raw_et.info["chs"]):
    print(ci, ch_info["ch_name"])
cals = read_eyelink_calibration(et_fpath)
print(f"number of calibrations: {len(cals)}")
first_cal = cals[0] # let's access the first (and only in this case) calibration
print(first_cal)
print(f"offset for each calibration point: {first_cal['offsets']}")
print(f"x-coordinate for each calibration point: {first_cal['positions'].T[0]}")

first_cal.plot()

first_cal["screen_resolution"] = (1920, 1080)
first_cal["screen_size"] = (0.53, 0.3)
first_cal["screen_distance"] = 0.9
mne.preprocessing.eyetracking.convert_units(raw_et, calibration=first_cal, to="radians")

ps_scalings = dict(pupil=1e3)
print("these are the channels names ----------------------------", raw_et.ch_names)
raw_et.plot(scalings=ps_scalings, block=True)
raw_et = et.interpolate_blinks(raw_et, interpolate_gaze=False)
raw_et.plot(scalings=ps_scalings, block=True)
print("These are the annotations", raw_et.annotations)
my_annot = mne.Annotations(
    onset=[*raw_et.annotations.onset, 3],
    duration=[*raw_et.annotations.duration, 1],
    description=[*raw_et.annotations.description, "BAD_foo"],
)
print(my_annot)
raw_et.set_annotations(my_annot)

raw_et.plot(scalings=ps_scalings, block=True)
raw_et = et.interpolate_blinks(raw_et, interpolate_gaze=False, match="BAD_foo")
raw_et.plot(scalings=ps_scalings, block=True)

```

How can I remove the existing annotations description and “rename” them? Right now it looks something like this:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/9/91d8f0143699f4ea942aa7f95dd79962ee147c6e.jpeg)

As we can clearly see, there’s a “BAD\_blink” but what if I want to rename it as “BAD\_something”?

---

<div class="post-metadata">

**Author:** ![aman-coder03](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/aman-coder03/32/4639_2.png) [@aman-coder03](https://mne.discourse.group/u/aman-coder03)\
**Post date:** [February 22, 2026, 5:49pm UTC](https://mne.discourse.group/t/need-some-help/11705/2 "2026-02-22T17:49:25Z")

</div>

You can’t modify annotation descriptions in-place, since `Annotations` are immutable. The usual approach is to create a new `Annotations` object with updated descriptions and then set it back on the raw object

For example

```python
annot = raw_et.annotations

new_desc = [
    "BAD_something" if d == "BAD_blink" else d
    for d in annot.description
]

raw_et.set_annotations(
    mne.Annotations(
        onset=annot.onset,
        duration=annot.duration,
        description=new_desc,
        orig_time=annot.orig_time,
    )
)

```

This will effectively “rename” `BAD_blink` to `BAD_something` while keeping timing and metadata intact

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [February 23, 2026, 10:17am UTC](https://mne.discourse.group/t/need-some-help/11705/3 "2026-02-23T10:17:41Z")

</div>

Actually, `Annotations` objects do have the [`rename`](https://mne.tools/stable/generated/mne.Annotations.html#mne.Annotations.rename) method that can be used to rename all instances of “BAD\_blink” to “BAD\_something”.

But if only specific “BAD\_blink” annotations should be renamed, reconstructing the object after making the modifications is a good route.

---

<div class="post-metadata">

**Author:** ![aman-coder03](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/aman-coder03/32/4639_2.png) [@aman-coder03](https://mne.discourse.group/u/aman-coder03)\
**Post date:** [February 23, 2026, 10:38am UTC](https://mne.discourse.group/t/need-some-help/11705/4 "2026-02-23T10:38:11Z")

</div>

Thanks for the correction @tsbinns! Good to know about the `.rename()` method

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 2, 2026, 10:38am UTC](https://mne.discourse.group/t/need-some-help/11705/5 "2026-03-02T10:38:31Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
