issue about the montage when reading eeglab .set file

  • MNE version: 1.6.0
  • operating system: Windows 10

I am trying to read eeglab .set data using io.read_raw_eeglab():

raw_set = mne.io.read_raw_eeglab(raw_file, preload = False)

But I got the following ValueError related to DigMontage:

ValueError: DigMontage is only a subset of info. There is 1 channel position not present in the DigMontage. The channel missing from the montage is:

[‘REF’].

Consider using inst.rename_channels to match the montage nomenclature, or inst.set_channel_types if this is not an EEG channel, or use the on_missing parameter if the channel position is allowed to be unknown in your analyses.

Hello @Mokita and welcome to the forum!

Honest question, is the error message not helpful for you here? We were trying to produce a message that provides direct guidance to users, but apparently we didn’t succeed. Could you help us understand how we could improve? Which parts of the message can you not understand?

Thank you very much!
Richard

Hello again, I’m only now realizing the error occurs while reading the file already; hence, the error message here is, in fact, totally unhelpful!

Maybe @sappelhoff can help?

Best wishes,
Richard

Perhaps pretending that REF is an EOG channel works?

raw_set = mne.io.read_raw_eeglab(raw_file, preload=False, eog=["REF"])
2 Likes

This seems like a crude hack … I think we should improve things in MNE-Python to make this a smoother experience/

2 Likes

Hi, @richard and @sappelhoff

Thank you for you reply!

The solution works, I can set the [‘REF’] as eog and drop that later! Although it seems indirect.

I think when I read raw file like brainvision .vhdr file, I can use the io firstly, and then drop the [‘REF’] channel and set the montage.