Tags: dataformat bids

Getting started with BIDS

BIDS, the Brain Imaging Data Structure, is a community driven standard to organize neuroimaging data and metadata to make it easier to analyze, archive and share. BIDS is not a data format on itself, but rather a standardized directory structure with standardized file names and agreements on the strategy on sharing metadata to make the dataset more FAIR.

To read more about BIDS, please see the website or look up the details in the specification.

Reading data from a BIDS dataset

FieldTrip has direct support for all data file formats that are used in BIDS. This includes:

Furthermore, there are a number of BIDS extension proposals (so called BEPs) that are likely to be part of the BIDS specification in the near future. Some of these are:

When you read raw data that is represented in the BIDS organization, the corresponding sidecar files are also read. In the case of MEG, EEG and iEEG that means that the corresponding json file and the _channels.tsv file are read. Channel names in the original (binary) file format will be overruled with those in the channels file. Also the _events.tsv file will be read, events that are in the original (binary) file will be replaced by those from the events file.

If you want to avoid reading the channels and/or events from the BIDS sidecar files, you can specify in the low-level functions the readbids or cfg.readbids option as ‘no’.

Writing data to a BIDS dataset

Using the data2bids function you can organize your data according to BIDS. It supports three methods:

  • decorate: use this if the data is already in the right file format, with the right filename and in the right directory
  • copy: use this if the data is already in the right file format, but not with the filename and not in the right directrory
  • convert: use this if the data is in a file format that is not supported according to the BIDS specification, or with raw or minimally preprocessed data in memory

There are various examples that show how to convert different types of data: