importing epoched data without events

External Email - Use Caution

Hi all,
I have continuous eeg data that contain one event.
I did two different epoching for the same event to my EEG data in
EEGLAB. Now after the epoching I got two epoched sets with the same
epochs number but different size for each epoch.
One set contains the event. The other one doesn't contain the event
(because I chose the range of the epoching to be out of the event).
When trying to import the data with mne.io.read_epochs_eeglab(filename)
It imports correctly for the data with events but when trying to
import with the data without events then I get the following error
message:
index 0 is out of bounds for axis 0 with size 0

How to solve this? Many many thanks for any help.

External Email - Use Caution

can you share the file?

what version of mne are you suing (can you run `mne.sys_info()` for me)?

Thx

External Email - Use Caution

Hi,
Thanks for the kind reply. I sent the file to you at mailsik at gmail.com
I noticed that in case the epoching is after the
event then the error message is:
IndexError: list index out of range
if the epoching is before the event then I get the following error message:
index 0 is out of bounds for axis 0 with size 0

I get this by running mne.sys_info()
Platform: Windows-10-10.0.17134-SP0
Python: 3.6.7 (default, Feb 28 2019, 07:28:18) [MSC v.1900 64
bit (AMD64)]
Executable: C:\ProgramData\Anaconda3\pythonw.exe
CPU: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel: 4 cores
Memory: 15.9 GB

mne: 0.17.1
numpy: 1.16.2 {blas=mkl_rt, lapack=mkl_rt}
scipy: 1.2.1
matplotlib: 3.0.3 {backend=module://ipykernel.pylab.backend_inline}

sklearn: 0.20.2
nibabel: 2.3.3
mayavi: Not found
cupy: Not found
pandas: 0.24.1
dipy: 0.15.0

Many many thanks in advance for any help

Sik <mailsik at gmail.com>, 17 Nis 2019 ?ar, 13:38 tarihinde ?unu yazd?:

External Email - Use Caution

yes. your file breaks the `mne.io.read_epoch_eeglab` reader.

Here's a Minimum Working Example exposing the issue

import mne
import os.path as op
from mne.externals.pymatreader import read_mat
from mne.utils import Bunch

confidential_path = op.join(op.dirname(mne.__file__), '..', 'sandbox',
'data', 'confidential')
fname = op.join(confidential_path, 'start0.1-0.2.set')

eeg = read_mat(fname, uint16_codec=None)
eeg = Bunch(**eeg['EEG'])

# This condition does not hold and produces buffer overflow
assert len(eeg.epoch) == int(eeg.trials)

Could you open an issue in MNE? It would be great if you could share this
file openly (or generate a sharable file that fails in the same manner)
you should adapt the fname.

Best, sik.