BrainStat : A toolbox for statistical analysis of neuroimaging data

https://img.shields.io/badge/License-BSD%203--Clause-blue.svg https://github.com/MICA-MNI/BrainStat/actions/workflows/python_unittests.yml/badge.svg https://github.com/MICA-MNI/BrainStat/actions/workflows/MATLAB_unittests.yml/badge.svg https://readthedocs.org/projects/brainstat/badge/?version=master&style=plastic https://img.shields.io/badge/code%20style-black-000000.svg https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg

Welcome to BrainStat’s documentation!

BrainStat is a toolbox for the statistical analysis and context decoding of neuroimaging data. It implements both univariate and multivariate linear models and interfaces with the BigBrain Atlas, Allen Human Brain Atlas and Nimare databases. BrainStat flexibly handles common surface, volume, and parcel level data formats, and provides a series of interactive visualization functions. The toolbox has been implemented in both Python and MATLAB, the two most widely adopted programming languages in the neuroimaging and neuroinformatics communities. It is openly available, and documented here.

https://github.com/MICA-LAB/BrainStat/blob/master/docs/figures/brainstat_logo_bw.png?raw=true

Developers

  • Sara Lariviere - MICA Lab, Montreal Neurological Institute

  • Şeyma Bayrak - Max Planck Institute for Human Cognitive and Brain Sciences

  • Reinder Vos de Wael - MICA Lab, Montreal Neurological Institute

  • Oualid Benkarim - MICA Lab, Montreal Neurological Institute

  • Raul Cruces - MICA Lab, Montreal Neurological Institute

  • Jessica Royer - MICA Lab, Montreal Neurological Institute

  • Peer Herholz - Montreal Neurological Institute

  • Seok-Jun Hong - Sungkyunkwan University

  • Sofie Valk - Max Planck Institute for Human Cognitive and Brain Sciences

  • Boris Bernhardt - Montreal Neurological Institute

License

The BrainStat source code is available under the BSD (3-Clause) license.

Support

If you have problems installing the software or questions about usage and documentation, or something else related to BrainStat, you can post to the Issues section of our repository.

Installation Guide

BrainStat is available in Python and MATLAB.

Python installation

BrainStat requires Python 3.7+. Assuming you have the correct version of Python installed and aliased to python, you can install BrainStat by running the following

python -m pip install brainstat
Python Dependencies

If you want to use the meta analysis module, you’ll also have to download and install the package pyembree. This package is only available through conda-forge:

conda install -c conda-forge pyembree

MATLAB installation

This toolbox is compatible with MATLAB versions R2019b and newer.

We recommend installing the toolbox through the Mathworks FileExchange. Simply download the file as a toolbox and open the .mltbx file in MATLAB. Alternatively, you can install the same .mltbx file from our GitHub Releases.

If you don’t want to install BrainStat as a MATLAB Toolbox, you can also simply download the repository and run the following in MATLAB:

addpath(genpath('/path/to/BrainStat/brainstat_matlab/'))

If you want to load BrainStat every time you start MATLAB, type edit startup and append the above line to the end of this file.

MATLAB Dependencies

BrainStat relies on functionality included in the BrainSpace toolbox. Please see the BrainSpace installation guide for installation instructions.

If you wish to open gifti files (required for data loader function) you will also need to install the gifti library.

Python Index

API

Below are links to descriptions of the important MATLAB functions used in BrainStat. The API for the surface visualization function plot_hemispheres can be found here.

Neuroimaging statistics toolbox.

Modules

brainstat.context

BrainStat’s context decoding module.

brainstat.datasets

Data included with BrainStat.

brainstat.mesh

Module for the handling of meshes and mesh data.

brainstat.stats

The statistics tools of BrainStat

brainstat.tests

Unit tests and their data generation.

brainstat.tutorial

Functions required for the BrainStat Tutorials

MATLAB Index

MATLAB Tutorials

For MATLAB tutorials, we recommend viewing these either through the Examples tab on our FileExchange page, or by opening the files in MATLAB (PACKAGE_DIRECTORY/tutorials). Alternatively, we’ve also included copies of these live scripts in ReadTheDocs:

MATLAB API

Below are links to descriptions of the important MATLAB functions used in BrainStat. The API for the surface visualization function plot_hemispheres can be found here.

Funding

Our research is kindly supported by:

  • Canadian Institutes of Health Research (CIHR)

  • National Science and Engineering Research Council of Canada (NSERC)

  • Azrieli Center for Autism Research

  • The Montreal Neurological Institute]

  • Canada Research Chairs Program

  • BrainCanada

  • SickKids Foundation

  • Helmholtz Foundation

We would also like to thank these funders for training/salary support

  • Savoy Foundation for Epilepsy (to RV)

  • Richard and Ann Sievers Award (to RV)

  • Healthy Brain and Healthy Lives (to OB)

  • Fonds de la Recherche du Quebec - Sante (to BB)

Credits

Some references that are incorporated into BrainStat

SurfStat references

Worsley KJ et al. (2009) A Matlab toolbox for the statistical analysis of univariate and multivariate surface and volumetric data using linear mixed effects models and random field theory. NeuroImage, Volume 47, Supplement 1, July 2009, Pages S39-S41. https://doi.org/10.1016/S1053-8119(09)70882-1

Chung MK et al. (2010) General Multivariate Linear Modeling of Surface Shapes Using SurfStat Neuroimage. 53(2):491-505. doi: 10.1016/j.neuroimage.2010.06.032

Random field theory references

Adler RJ and Taylor JE (2007). Random fields and geometry. Springer. Hagler DJ Saygin AP and Sereno MI (2006). Smoothing and cluster thresholding for cortical surface-based group analysis of fMRI data. NeuroImage, 33:1093-1103.

Hayasaka S, Phan KL, Liberzon I, Worsley KJ and Nichols TE (2004). Non-Stationary cluster size inference with random field and permutation methods. NeuroImage, 22:676-687.

Taylor JE and Adler RJ (2003), Euler characteristics for Gaussian fields on manifolds. Annals of Probability, 31:533-563.

Taylor JE and Worsley KJ (2007). Detecting sparse signal in random fields, with an application to brain mapping. Journal of the American Statistical Association, 102:913-928.

Worsley KJ, Andermann M, Koulis T, MacDonald D, and Evans AC (1999). Detecting changes in non-isotropic images. Human Brain Mapping, 8:98-101.

Multivariate associative techniques

Contextualization