Dropped epochs when using compute_tfr

  • MNE version: 1.9.0
  • operating system: macOS-12.6

I am trying to compute a multitaper spectrogram using SEEG data. All epochs are dropped (only one epoch) when I try to compute the spectrogram despite specifying no rejection when epoching the data. When I use drop_log, it responds with TOO_SHORT. See here for info about the trial_ieeg function: trial_ieeg — IEEG_Pipelines 0.1 documentation.

HG_5.annotations.onset[0] is 234.6.

Relevant code:

raw5_der = mne.io.read_raw(filename)
# preprocessing steps (line noise filter, outlier channel rejection, common average reference)
HG_keys = ['L4ST3', 'L4ST4', 'L4ST5', 'L4ST6', 'L4ST8'] # specific channels to plot
HG_5 = raw5_der.copy()
HG_5_keys = [key for key in HG_keys if key in HG_5.ch_names]
HG_5 = HG_5.pick(HG_5_keys)
freq = np.arange(1, 50., 1.) # frequencies of interest
HG_5_trials = trial_ieeg(HG_5, event = HG_5.annotations.description[0], times = [HG_5.annotations.onset[0] - 40, HG_5.annotations.onset[0]], flat = None, reject_by_annotation = False, reject = None) # epoching data from 40s before event to onset of event
spectra5 = HG_5_trials.compute_tfr("multitaper", freq, time_bandwidth=10, n_cycles=freq/2) # compute multitaper spectrogram

Error message:

#/var/folders/nm/_3c9jt3s0zq2fl0rb9nx322w0000gr/T/ipykernel_42919/1395523346.py:8: #RuntimeWarning: All epochs were dropped!
#You might need to alter reject/flat-criteria or drop bad channels to avoid this. You can use #Epochs.plot_drop_log() to see which channels are responsible for the dropping of epochs.

Hello,

compute_tfr shouldn’t drop any epochs which aren’t already marked as bad in the Epochs object.
What are the properties of HG_5_trials? Does it look the same if you construct it using the Epochs class directly and not with this other function?

Cheers,
Thomas

Hi Thomas,

Using the Epochs class worked! Thank you for your help!

Best,
Julia

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.