Brainstorm's Database Structure
Authors: Martin Cousineau, Raymundo Cassani
Understanding the data structures used by Brainstorm is paramount when you want to work on the development of the software. In this page, we will describe the data structures used to store information about a dataset, both in memory and on the hard drive.
Contents
On the hard drive
When you first launch Brainstorm, it asks you to create a Brainstorm database directory (brainstorm_db) on your hard drive. Inside this directory, Brainstorm will create an individual folder for each protocols. This is where the data of a protocol will reside on your hard drive. The database explorer of the software (data tree) is populated directly from the files located in this folder. It has a strict hierarchy, explained in the bullet list below:
anat: This is where Anatomy files (e.g. MRI, surfaces) and subject's metadata are stored.
One folder per subject
brainstormsubject.mat: Metadata of the subject, see db_template('subjectmat')
subjectimage_*.mat: MRI files
tess_*.mat: Surface files
data: This is where Functional files (e.g. channels, recordings) and study's metadata are stored.
protocol.mat: All metadata of this protocol, as Matlab structs. See next section for details. Refer to variable ProtocolMat of function db_save().
protocol.db: All metadata of this protocol, as an SQLite database. See next section for details. Refer to sql_generate_db().
One folder per subject
One folder per study
brainstormstudy.mat: Metadata of the study, see db_template('studymat')
channel_*.mat: Channel files
data_*.mat: Data (recording) files
- Etc.