# problems with reading mff files

**URL:** <https://mne.discourse.group/t/problems-with-reading-mff-files/5593>\
**Category:** Support & Discussions\
**Created:** [September 18, 2022, 1:29pm UTC](https://mne.discourse.group/t/problems-with-reading-mff-files/5593 "2022-09-18T13:29:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elba1212](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/elba1212/32/1906_2.png) [@elba1212](https://mne.discourse.group/u/elba1212)\
**Post date:** [September 18, 2022, 1:29pm UTC](https://mne.discourse.group/t/problems-with-reading-mff-files/5593/1 "2022-09-18T13:29:24Z")

</div>

- 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.

```python
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:

```python
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:

> **[EL3003\_SLEEP\_20220221\_015208.mff](https://www.dropbox.com/sh/8qt0nslqdjsh1ik/AAB3I6eZBvvUS3rncILJbVlra?dl=0)**
>
> Shared with Dropbox

sub3004:

> **[EL3004\_SLEEP\_20220309\_125216.mff](https://www.dropbox.com/sh/y6q5txmcteubf8u/AAD3AY7vu4MgIzrrW3krWvqHa?dl=0)**
>
> Shared with Dropbox

---

<div class="post-metadata">

**Author:** ![elba1212](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/elba1212/32/1906_2.png) [@elba1212](https://mne.discourse.group/u/elba1212)\
**Post date:** [September 19, 2022, 7:48am UTC](https://mne.discourse.group/t/problems-with-reading-mff-files/5593/2 "2022-09-19T07:48:38Z")

</div>

I can read both of these files with mffpy.

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [September 19, 2022, 8:23am UTC](https://mne.discourse.group/t/problems-with-reading-mff-files/5593/3 "2022-09-19T08:23:03Z")

</div>

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

Alex

---

<div class="post-metadata">

**Author:** ![elba1212](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/elba1212/32/1906_2.png) [@elba1212](https://mne.discourse.group/u/elba1212)\
**Post date:** [September 19, 2022, 10:14am UTC](https://mne.discourse.group/t/problems-with-reading-mff-files/5593/4 "2022-09-19T10:14:10Z")

</div>

thank for the reply.  
I opened an issue #11188
