problems with reading mff files

  • MNE version: 1.1.1
    tried also 1.2.dev0 version and the error persisted.
  • operating system: Windows 10

Hi,
I am trying to open data files that recorded with EGI system, with mne.io.read_raw_egi.
for some recordings it works perfectly fine and for others I get an error message.

here is an example code and files. for sub3003 I can read the file and for sub3004 I get an error message.

import mne

sub3003 = r"C:\Users\paltiele.WISMAIN\Dropbox (Weizmann Institute)\PhD\Learning_faces\EEG experiment\data\EEG\EL3003\EL3003_SLEEP_20220221_015208.mff"
raw3003 = mne.io.read_raw_egi(sub3003)

sub3004 = r"C:\Users\paltiele.WISMAIN\Dropbox (Weizmann Institute)\PhD\Learning_faces\EEG experiment\data\EEG\EL3004\EL3004_SLEEP_20220309_125216.mff"
raw = mne.io.read_raw_egi(sub3004)

the error is:

sub3004 = r"C:\Users\paltiele.WISMAIN\Dropbox (Weizmann Institute)\PhD\Learning_faces\EEG experiment\data\EEG\EL3004\EL3004_SLEEP_20220309_125216.mff"
raw = mne.io.read_raw_egi(sub3004)
Reading EGI MFF Header from C:\Users\paltiele.WISMAIN\Dropbox (Weizmann Institute)\PhD\Learning_faces\EEG experiment\data\EEG\EL3004\EL3004_SLEEP_20220309_125216.mff...
Traceback (most recent call last):

  File "C:\Users\paltiele.WISMAIN\AppData\Local\Temp\ipykernel_12524\2134038754.py", line 2, in <module>
    raw = mne.io.read_raw_egi(sub3004)

  File "<decorator-gen-260>", line 12, in read_raw_egi

  File "C:\Users\paltiele.WISMAIN\Anaconda3\envs\for_visbrain\lib\site-packages\mne\io\egi\egi.py", line 157, in read_raw_egi
    exclude, preload, channel_naming, verbose)

  File "<decorator-gen-257>", line 12, in _read_raw_egi_mff

  File "C:\Users\paltiele.WISMAIN\Anaconda3\envs\for_visbrain\lib\site-packages\mne\io\egi\egimff.py", line 390, in _read_raw_egi_mff
    preload, channel_naming, verbose)

  File "<decorator-gen-258>", line 12, in __init__

  File "C:\Users\paltiele.WISMAIN\Anaconda3\envs\for_visbrain\lib\site-packages\mne\io\egi\egimff.py", line 404, in __init__
    egi_info = _read_header(input_fname)

  File "C:\Users\paltiele.WISMAIN\Anaconda3\envs\for_visbrain\lib\site-packages\mne\io\egi\egimff.py", line 212, in _read_header
    mff_hdr = _read_mff_header(input_fname)

  File "C:\Users\paltiele.WISMAIN\Anaconda3\envs\for_visbrain\lib\site-packages\mne\io\egi\egimff.py", line 93, in _read_mff_header
    list(epochs['last_samps'])))

RuntimeError: EGI epoch first/last samps could not be parsed:
[0]
[26586364]

links for the files:
sub3003:

sub3004:

I can read both of these files with mffpy.

can you open an issue at https://github.com/mne-tools/mne-python/issues and share a file there so we can
debug and close the issue?

Alex

thank for the reply.
I opened an issue #11188