Error in BIDSPath while reading openneuro BIDs

**:question: Errors with read_raw_bids with .edf files

  • MNE version:
    mne==0.24.1
    mne-bids==0.9

  • operating system: Manjaro 21.2.0

Hello there!
I’m having a problem with .set files in a dataset found in the OpenNeuro repository.
Now I am testing the ds003774 dataset, and it’s not getting the correct BIDSPath.
I guess it’s getting the session variable into the run variable; again, it’s a guess.
The code is the following:

BIDSPath

Thanks again guys

Best regards

Hello @AngelicaRibeiro,

I didn’t have time to look at your code in detail, but I quickly cooked up the following MWE:

# %%
from pathlib import Path
import openneuro
import mne_bids


bids_root = Path('/tmp/ds003774')

# %%
openneuro.download(
    dataset='ds003774',
    target_dir=bids_root,
    include=['sub-001']
)

# %%
bids_path = mne_bids.BIDSPath(
    subject='001',
    session='01',
    task='MusicListening',
    run='1',
    suffix='eeg',
    extension='.set',
    datatype='eeg',
    root=bids_root
)
raw = mne_bids.read_raw_bids(bids_path=bids_path)
print(raw)

This seems to work, although I’m getting quite a number of warnings:

Reading events from /tmp/ds003774/sub-001/ses-01/eeg/sub-001_ses-01_task-MusicListening_run-1_events.tsv.
Reading channel info from /tmp/ds003774/sub-001/ses-01/eeg/sub-001_ses-01_task-MusicListening_run-1_channels.tsv.
Reading in coordinate system frame Other: None.
<RawEEGLAB | sub-001_ses-01_task-MusicListening_run-1_eeg.set, 129 x 34009 (136.0 s), ~33.6 MB, data loaded>
/Users/hoechenberger/Development/mne-bids/mne_bids/read.py:59: RuntimeWarning: Data will be preloaded. preload=False or a string preload is not supported when the data is stored in the .set file
raw = reader[ext](raw_path, **kwargs)
/Users/hoechenberger/Development/mne-bids/mne_bids/read.py:59: RuntimeWarning: Omitted 106 annotation(s) that were outside data range.
raw = reader[ext](raw_path, **kwargs)
/Users/hoechenberger/Development/mne-bids/mne_bids/read.py:59: RuntimeWarning: Limited 2 annotation(s) that were expanding outside the data range.
raw = reader[ext](raw_path, **kwargs)
/Users/hoechenberger/Development/mne-bids/mne_bids/read.py:59: RuntimeWarning: The data contains ‘boundary’ events, indicating data discontinuities. Be cautious of filtering and epoching around these events.
raw = reader[ext](raw_path, **kwargs)
/Users/hoechenberger/Development/mne-bids/mne_bids/dig.py:502: RuntimeWarning: EEG Coordinate frame is not accepted BIDS keyword. The allowed keywords are: [‘ACPC’, ‘Pixels’, ‘Other’]
warn(“EEG Coordinate frame is not accepted "
/Users/hoechenberger/Development/mne-bids/mne_bids/read.py:754: RuntimeWarning: participants.tsv file not found for /tmp/ds003774/sub-001/ses-01/eeg/sub-001_ses-01_task-MusicListening_run-1_eeg.set
warn(f"participants.tsv file not found for {raw_path}”)

@sappelhoff this really doesn’t look great, eh??

mmh can maybe take a deeper look soon, but we should make mne-bids aware of the EEGLAB and EEGLAB-HJ coordinate frames, which are newly supported: Coordinate systems - Brain Imaging Data Structure v1.6.1-dev

okay, the EEGLAB and EEGLAB-HJ coordsystems weren’t even the issue. (I’ll still open an issue on mne-bids that we try to handle those, because new versions of EEGLAB-BIDS write these keywords to coordsystem.json).

Data will be preloaded. preload=False or a string preload is not supported when the data is stored in the .set file
raw = reader[ext](raw_path, **kwargs)

This issue comes from MNE-Python … we can address it in mne-bids by setting preload for .set to True always.

The boundary events warning is fair

the warning about omitted and/or limited annotations is worrying, that’s something I’d be grateful if you, @AngelicaRibeiro, could investigate further and alert us if it’s a problem with mne-bids or mne-python


I’ll open a couple of issues on mne-bids. But for more than that I don’t have time right now :slight_smile:

1 Like