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

**URL:** <https://mne.discourse.group/t/mne-epochs-response-events-disappear-when-locking-on-stimulus-events/2207>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [May 31, 2020, 8:22pm UTC](https://mne.discourse.group/t/mne-epochs-response-events-disappear-when-locking-on-stimulus-events/2207 "2020-05-31T20:22:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 31, 2020, 8:22pm UTC](https://mne.discourse.group/t/mne-epochs-response-events-disappear-when-locking-on-stimulus-events/2207/1 "2020-05-31T20:22:03Z")

</div>

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](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200531/33d062e0/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 1, 2020, 7:37am UTC](https://mne.discourse.group/t/mne-epochs-response-events-disappear-when-locking-on-stimulus-events/2207/2 "2020-06-01T07:37:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 1, 2020, 9:06am UTC](https://mne.discourse.group/t/mne-epochs-response-events-disappear-when-locking-on-stimulus-events/2207/3 "2020-06-01T09:06:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 1, 2020, 7:58pm UTC](https://mne.discourse.group/t/mne-epochs-response-events-disappear-when-locking-on-stimulus-events/2207/4 "2020-06-01T19:58:43Z")

</div>

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
