mne-tools / mne-tools/mne-python

Problems with reading mff files

Open
#11,188 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

BUG
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Description of the problem

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.

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

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

Steps to reproduce
import mne

sub3003 = r"C:\Users\paltiele.WISMAIN\Dropbox (Weizmann Institute)\PhD\Learning_faces\EEG experiment\data\samples\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\samples\EL3004_SLEEP_20220309_125216.mff"
raw3004 = mne.io.read_raw_egi(sub3004)
Link to data

subject 3003:
https://www.dropbox.com/s/ptgf959fdhs2ydn/EL3003_SLEEP_20220221_015208.mff.zip?dl=0

subject 3004:
https://www.dropbox.com/s/8ydahvu84dhv6f6/EL3004_SLEEP_20220309_125216.mff.zip?dl=0

Expected results

read the mff file smoothly

Actual results

Error message:

'''
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
raw = mne.io.read_raw_egi(sub3004)

File "", 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 "", 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 "", 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]
'''

Additional information

Platform: Windows-10-10.0.19041-SP0
Python: 3.7.13 (default, Mar 28 2022, 08:03:21) [MSC v.1916 64 bit (AMD64)]
Executable: C:\Users\paltiele.WISMAIN\Anaconda3\envs\for_visbrain\python.exe
CPU: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel: 8 cores
Memory: 31.7 GB

mne: 1.2.dev0
numpy: 1.21.6 {MKL 2022.1-Product with 4 threads}
scipy: 1.7.3
matplotlib: 3.5.3 {backend=module://matplotlib_inline.backend_inline}

sklearn: 1.0.2
numba: 0.56.2
nibabel: Not found
nilearn: Not found
dipy: Not found
openmeeg: Not found
cupy: Not found
pandas: 1.3.5
pyvista: Not found
pyvistaqt: Not found
ipyvtklink: Not found
vtk: Not found
qtpy: Not found
ipympl: Not found
pyqtgraph: Not found
pooch: v1.6.0

mne_bids: Not found
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: Not found
mne_connectivity: Not found
mne_icalabel: Not found

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the linked subject 3003 and 3004 MFF files using mne.io.read_raw_egi. Start in mne/io/egi/egimff.py at _read_mff_header and the epoch parsing that raises the error; done means both provided recordings can be read successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.