Hello everyone,
I have events that all have a HED that start with “Stimulus”. I want to know, for each stimulus, what type of stimulus followed it. I thought I could do that by using the “keep_first = “Stimulus”” argument in the code below, and I know this would work perfectly if the time locked event and the following one were not of the same type. But of course, in this case, since the time locked event is a Stimulus itself, it always gets registered as the first one, with a time of 0.
tmin = -0.1
tmax = 0.9
baseline = (-0.1, 0)
reject_criteria = dict(eeg=100e-6, eog=100e-6)
metadata, events, event_id = mne.epochs.make_metadata(
events=events, event_id=event_id, sfreq=cleaned.info['sfreq'],
tmin= 0, tmax= 3,
keep_first="Stimulus")
epochs = mne.Epochs(cleaned, events, event_id, tmin, tmax, baseline=baseline, metadata=metadata, preload=True)
So, I thought I could simply change the “tmin” argument to 0.01sec to exclude that time locked event. But then I get the error below. As I am sure that there are some events in that time window, that the script does catch when tmin=0, I think it means I just cannot use a metadata time window that does not include the time locked event itself.
"Traceback (most recent call last):
Input In [18] in <cell line: 110>
metadata, events, event_id = mne.epochs.make_metadata(
File ~\anaconda3\lib\site-packages\mne\epochs.py:2879 in make_metadata
assert not events_in_window.empty
AssertionError"
I feel like this should be simple and I am missing something obvious… but I am stuck.
Thank you in advance for your reply.
- MNE version: e.g. 1.4.2
- operating system: Windows 11