- MNE version: 1.9. 0
- operating system: Windows 10
Hello,
I have attempted to use mne.find_events to extract my stimulus triggers but have not been successful.
raw = mne.io.read_raw_edf(edf_path)
raw.copy().pick(picks='TRIG').plot(start=100, duration = 2000, scalings = {'eeg' : 12000e-6}) #displays a plot with the triggers visible
events = mne.find_events(raw, stim_channel ='TRIG')
print(events) #returns []
I understand MNE is looking for a ‘stim’ channel but is unable to locate it. Therefore, I attempted to assign the correct channel type (stim) to ‘TRIG’ though the following:
stim_chans = ['TRIG'] #along with assigning other channel types
ch_labels = list(seeg_chans +ecog_chans + misc_chans + ecg_chans + eeg_chans + stim_chans)
ch_types = list(list(np.tile('seeg', len(seeg_chans))) + \
list(np.tile('ecog', len(ecog_chans))) + \
list(np.tile('misc', len(misc_chans))) + \
list(np.tile('ecg', len(ecg_chans))) + \
list(np.tile('eeg', len(eeg_chans))) + \
list(np.tile('stim', len(stim_chans))))
chan_type_dict = dict(zip(ch_labels, ch_types))
After this, I attempted to verify that I assigned ‘TRIG’ as my stim channel. Then I proceeded to use mne.find_events again.
from mne import pick_types
picks=pick_types(raw.info,stim=True)
print(picks) #returns [273]
mne.channel_type(raw.info,273) #returns 'stim'
events =mne.find_events(raw, stim_channel = 'TRIG')
print(events) #returns []
mne.find_events(raw, stim_channel="TRIG") #returns array([], shape=(0, 3), dtype=int32)
I wonder if I’m still not assigning the stimulus channel correctly. I know ‘TRIG’ is where my triggers are as I can visually see them when I plot the channel, but I cannot extract the events.