mne.Epochs: response events disappear when locking on stimulus events

External Email - Use Caution

Hi Community,
I would like to segment my EEG data into epochs of -300 to 1900 ms relative to stimulus onset, and keep response triggers in these epochs.
I then computed:
epochs = mne.Epochs(raw_EEG_av_ref_filt, raw_events, events_stim, tmin=-0.3, tmax=1.9,
baseline=(-.3, 0), preload=True)
However, the epoched data only contain stimulus events (events_stim), and response events have been dropped. Is there a way to keep response events? In addition, is it possible to epoch again my 'epochs' object (say I want to lock the signal -100 to +100 ms relative to the response)?
Best,
Mat

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200531/33d062e0/attachment.html

External Email - Use Caution

Dear Mat,

to keep the stim channel in the Epochs you need to pass the picks
parameter making sure it contains the stim channel in the list.

To repochs it's no so easy right now. You would need to start
from raw again. Or you can make it work using EpochsArraw
dealing with numpy directly.

Given how many times this question as been asked I feel we need
an example on the MNE website for this usecase. We would
need first a good public dataset to demo this.

Alex

External Email - Use Caution

Hi Alex,
Thanks for the help. I tried passing the stim channel using:
epochs = mne.Epochs(raw_EEG_av_ref_filt, raw_events, event_stim_dict, tmin=-0.2, tmax=1.8,
baseline=(-.2, 0), preload=True, picks = ['eeg','eog','stim'])
However, epochs.events still only contains locking events (removing response triggers)
Am I doing something wrong?
Mat

External Email - Use Caution

you're doing nothing wrong. It won't be in events but you will have the
stim channel
in the epochs.get_data() so technically you can find the onset of the
response and
do what you want via an EpochsArray. But I agree it's far from trivial.

Sorry but I don't a better solution to offer. Maybe someone here can
suggest something

If I have access to data with this I can try to make an example

Alex