Loading files from the multi-modal-human-neuroimaging-dataset

I’m trying to analyze this MEG public dataset:

When I’m trying to create epochs, all of them are dropped, and I’m not sure why.
I tried to debug it, and it fails in the epochs._get_data function.
The _get_epoch_from_raw function returns None.
This code reproduces this problem:

raw_fname = ‘…/sub001/MEG/run_01_raw.fif’
raw = mne.io.read_raw_fif(raw_fname, preload=True)
picks = mne.pick_types(raw.info, meg=True, eeg=True, eog=False, exclude=‘bads’)
events_fname = ‘…/sub001/model/model001/onsets/task001_run001/cond001.txt’
events = mne.read_events(events_fname)
events_conditions = {‘scrambled’: 1}
epochs = mne.Epochs(raw, events, events_conditions, picks=picks, preload=True)


Hey Noam, could it be that your events are outside the data range, perhaps by not accounting for raw.first_samp properly? You might be able to solve by just adding raw.first_samp to the first column of your events.

Hello @pelednoam, and welcome to the forum!

first off, you shouldn’t be using openfmri.org anymore; the project now lives at https://openneuro.org.

You can find that specific dataset here:

You can download the data via openneuro-py.

Secondly, you must use MNE-BIDS to load the data, as it’s BIDS-formatted. Otherwise you will run into issues.

If you’re still having problems, please let us know.

Best wishes,


@richard, it doesn’t look like the fif files are in the openneuro link… not sure if they didn’t port them over or what.

I am sorry, @alexrockhill and @pelednoam, I shared the wrong link.

The correct download location for ds000117 from OpenNeuro.org is:

I have edited my above response accordingly.

FYI we actually use this dataset as an example to showcase some of the features of the MNE-BIDS-Pipeline, see:

Faces dataset - MNE-BIDS-Pipeline

1 Like

@pelednoam Did you have any luck with this?

Nice, that looks like it should be compatible with MNE BIDS for sure. @pelednoam, this tutorial code will almost surely work and will fill extra fields in the raw object that will probably be useful 01. Read BIDS datasets — MNE-BIDS 0.10 documentation.

1 Like