mne-bids: How to deal with datasets that don't come with events.tsv, but have events saved as part of the raw data?

ds000246 doesn’t ship with *_events.tsv. Yet, we’ve managed to successfully process it for months using the mne-study-template. Turns out the dataset has events stored in the raw data (as annotations, I believe), so when reading the data using MNE-BIDS, we do get access to those events, even though the BIDS sidecars do not expose any.

I believe this should not happen: annotations & events should be constructed based on the sidecar information alone. When reading a file, we should call raw.set_annotations(None) early on, so that if no *_events.tsv is present, we’d end up without any Annotations. Otherwise we risk leading our users to believe they’re dealing with BIDS-compliant data when in fact the only reason they’re getting access to events is due to implementation details in MNE and MNE-BIDS.

Thoughts?

cc @agramfort @sappelhoff @adam2392 @jasmainak

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 27 (26 by maintainers)

Most upvoted comments

again – I don’t suggest a full validation but mostly to leverage the regular expressions and schemas to use them for checks in certain functions for subsets of files. E.g., if the user wants to read in a raw file, we should check that the events file is present and in BIDS naming format. And the rest is just a matter of organization. Having such checks in one file _validator.py will help keeping things consolidated and might develop into something more concrete down the line. But that’s not what I’m suggesting right now 😃

the JSON schemas and the reg-exps are more or less the “core” of the BIDS validator (IMHO), and these could easily be turned into their own repos, and included in all validators as git submodules, thus being easily updated.

I think they should go into https://github.com/bids-standard/bids-schema and this should be released to regularly on NPM so one can easily depend on it…

I agree, if data is read via read_raw_bids, the bids-sidecar files should determine the events, not what’s in the raw files. Everything else feels like a user is conveniently “hacking” BIDS by storing their events in the FIFF file, not bothering about BIDS recommendations.

Yeah well I’d rather start from scratch… and not before this weekend, quite busy currently!