Channel location not correctly recognized when adding two reference channels using `add_reference_channels`

  • MNE version: 1.9.0
  • operating system: macOS 15

Hello,

I was trying to add two reference channels. But it looks like the channel locations are not correctly loaded when I add the two reference channels together by mne.add_reference_channels(raw, ref_channels = ['TP9', 'TP10']) (both channels show up at the location of TP10.):

But if I add the two channels sequentially by
mne.add_reference_channels(raw, ref_channels = ['TP9'])
mne.add_reference_channels(raw, ref_channels = ['TP10'])
the channel locations are correct:

I wonder if if it’s a bug or did I miss something?

Thank you!

Here is the code snipeets to reproduce the figures:


# load data
ssvep_folder = mne.datasets.ssvep.data_path()
ssvep_data_raw_path = (
    ssvep_folder / "sub-02" / "ses-01" / "eeg" / "sub-02_ses-01_task-ssvep_eeg.vhdr"
)
ssvep_raw = mne.io.read_raw_brainvision(ssvep_data_raw_path, verbose=False, preload=True)

# Apply a template montage directly, without preloading
ssvep_raw.set_montage("easycap-M1")
# remove TP9 and TP10
ssvep_raw.drop_channels(['TP9', 'TP10'])

# add 2 reference channels together
raw1 = mne.add_reference_channels(ssvep_raw, ref_channels = ['TP9', 'TP10'])
raw1.set_montage("easycap-M1")
fig = raw1.plot_sensors(show_names=True)


# add 2 reference channels separately
raw2 = mne.add_reference_channels(ssvep_raw, ref_channels = ['TP9'])
raw2 = mne.add_reference_channels(raw2, ref_channels = ['TP10'])
raw2.set_montage("easycap-M1")
fig = raw2.plot_sensors(show_names=True)

Hello @chaohanch and welcome to the forum! This seems like a bug to me … I’ll try to reproduce and report back.

Richard

1 Like

I’ve reported the issue on the GitHub issue tracker:

2 Likes

Thank you for reporting this!

1 Like

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