- MNE-Python version: 0.19.0
- operating system: Linux
Dear MEG developers,
My colleague and I are encountering a problematic situation while saving the epochs of a participant. While initially all the epochs are good, at the moment of saving, the epochs.save function removes 2 epochs.
We checked that :
epochs.drop_log() contained only empty lists
epochs.drop_bads() doesn’t drop any epoch
We set annotations to None by running: epochs.set_annotations(None).
When saving, no message indicates that bad epochs were dropped but yet, when we load the epochs, the two last epochs are dropped.
Something that seems to be at the origin of this problem is that we use « STI008 » as the stim channel and that there is a trigger in the channel « STI101 » that happens before the 2 last triggers of STI008. These 2 last ones are the ones that are later removed automatically by the saving function.
We think this is a bug. Here is a snippet of code that should allow you to reproduce the problem (mne version ‘0.19.0’). How can we send you the problematic data ? It is on the NeuroSpin server.
Thank you very much.
Fosca & Samuel
import mne data_folder = "/neurospin/meg/meg_tmp/ABSeq_Samuel_Fosca2019/data/MEG/" data_path = data_folder + "/data_bug_mne/bug_data_raw.fif" tmin = -0.050 tmax = 0.600 raw = mne.io.read_raw_fif(data_path,preload=True) events = mne.find_events(raw, stim_channel="STI008", consecutive=True, min_duration=0.002, shortest_event=1) epochs = mne.Epochs(raw, events, None, tmin, tmax, proj=True, baseline=None, preload=False, decim=1, reject=None) data_path_save = data_folder + "/data_bug_mne/test-epo.fif" epochs.save(data_path_save)