Issue with importing markers from EDF file

Hi MNE users,

I have a problem with importing markers from EDF files to MNE. I have markers in the file but mne.find_events() cannot find the markers. I found similar problem in this discussion (Setting the Marker channel - #19 by system) and I tried the suggestion but it didn’t work. I’m using MNE version: 0.23.3 on Windows 10.
This is an example of my file: TEST_file.edf - Google Drive

Following is the code that I’m using:
raw=mne.io.read_raw_edf(Data_path, preload=True)
raw.set_channel_types({'MarkerValueInt': 'stim'})
events = mne.find_events(raw, stim_channel='MarkerValueInt')
raw_Slected_channel=raw.copy().pick_channels(['AF3','F7','F3','FC5','T7','P7','O1','O2','P8','T8','FC6','F4','F8','AF4'])
raw_Slected_channel.plot(events=events)
I would be highly appreciated if you can help me with this problem.

Kind regards,
Mostafa

Hello @Mostafa,

you can specify the trigger channel name upon reading. The following works for me:

# %%
import mne

raw = mne.io.read_raw_edf(
    input_fname='TEST_file.edf',
    stim_channel='MarkerValueInt'
)
events = mne.find_events(raw)

Please note that there seems to be a number of other channels that are not EEG channels, but MNE blindly classifies them as “eeg”. You should correct the channel types before doing any further data analysis. But the code above should at least resolve your trigger question.

Best wishes,
Richard

A post was split to a new topic: Splitting Event IDs