BIDS for MATLAB / Octave

This repository aims at centralising MATLAB/Octave tools to interact with datasets conforming to the BIDS (Brain Imaging Data Structure) format.

For more information about BIDS, visit https://bids.neuroimaging.io/.

Join our chat on the BIDS-MATLAB channel on the brainhack mattermost and our google group.

See also PyBIDS for Python and the BIDS Starter Kit.

Installation, Features

Please see the relevant sections of the README

Usage

BIDS matlab is structured as package, so you can easily access functions in subfolders that start with +.

To use the +bids/layout.m function:

BIDS = bids.layout('/home/data/ds000117');
bids.query(BIDS, 'subjects')

To use the +bids/+util/jsondecode.m function:

content = bids.util.jsondecode('/home/data/some_json_file.json');

A tutorials are available as a Jupyter Notebooks and scripts and can be run interactively via Binder.

Reading and writing JSON files

If you are using MATLAB R2016b or newer, nothing else needs to be installed.

If you are using MATLAB R2016a or older, or using Octave, you need to install a supported JSON library for your MATLAB or Octave. This can be any of:

Implementation

Starting point was spm_BIDS.m from SPM12 (documentation) reformatted in a +bids package with dependencies to other SPM functions removed.