mne-tools / mne-tools/mne-python

Multiple issues while reading and resampling raw mff

Open
#11,380 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

I've seen the issue #11188, it seems similar to the error I get, but I haven't quite understand where does the problem come from and if there are any existing solutions.
I tried to find some workaround for the problem, that's where I've got so far:

  1. First issue (see first screenshot in actual results) was solved by commenting out the following code in the /mne/io/egi/egimff:
if bad:
    raise RuntimeError('EGI epoch first/last samps could not be parsed:\n'
                       '%s\n%s' % (list(epochs['first_samps']),
                                   list(epochs['last_samps'])))
  1. The second issue (second screenshot) seems unrelated to the first one. The workaround is to remove Events_User Markup.xml file from the .mff. After that mne reads .mff successfully.
  2. The third issue appears while trying to resample. I'm not sure if there is any connection to the previous ones, but I'm stuck with it currently.

I'm not sure if it's an MNE bug, so I apologise in advance if it's not.
Do you have any insight about roots of the issues? Could you please advise how to proceed?

Steps to reproduce
raw = mne.io.read_raw_egi(path_to_uploaded_mff)
raw.resample(250)
Link to data

Link to the mff (google drive)

Expected results

Load and resample the mff file successfully.

Actual results
  1. image
  2. image
  3. image
Additional information
Platform:         Windows-10-10.0.20348-SP0
Python:           3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Executable:       D:\!eeg-processing-pipeline\code\.venv\Scripts\python.exe
CPU:              Intel64 Family 6 Model 167 Stepping 1, GenuineIntel: 16 cores
Memory:           63.9 GB

mne:              1.2.3
numpy:            1.23.5 {OpenBLAS 0.3.20 with 16 threads}
scipy:            1.9.3
matplotlib:       3.6.2 {backend=TkAgg}

sklearn:          1.2.0
numba:            0.56.4
nibabel:          Not found
nilearn:          Not found
dipy:             Not found
openmeeg:         Not found
cupy:             11.4.0
pandas:           1.5.2
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

Start with mne.io.read_raw_egi and the code in /mne/io/egi/egimff, using the linked .mff data and the reported raw.resample(250) sequence. Reproduce the epoch parsing, Events_User Markup.xml, and resampling failures separately; done means the file loads and resamples without requiring code to be commented out or files removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.