Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

Major revision of the Python GLMsingle. This merge refactors the python side of GLMsingle with handling of data in volumetric space by default when volumetric is passed. Figures are now pretty much identical with the matlab implementation. This should not affect how users call GLMsingle in Python.

Git stats


Failed to load latest commit information.



GLMsingle is a toolbox for obtaining accurate single-trial estimates in fMRI time-series data. We provide both MATLAB and Python implementations.

GLMsingle is detailed in the following paper:

Prince, J.S., Charest, I., Kurzawski, J.W., Pyles, J.A., Tarr, M., Kay, K.N. Improving the accuracy of single-trial fMRI response estimates using GLMsingle. eLife (2022).

For additional documentation and FAQ on GLMsingle, please see:

For a lecture overview, implementation guide, and demo of GLMsingle, please see:

For a video walkthrough of the figure outputs from GLMsingle, please see:

GLMsingle can be viewed as a wholesale replacement of its predecessor, GLMdenoise (

If you have questions or discussion points, please use the Discussions feature of this github repository. If you find a bug, please let us know by raising a github Issue.


To install:

git clone --recurse-submodules

This will also clone fracridge as a submodule.

To use the GLMsingle toolbox, add it and fracridge to your MATLAB path by running the setup.m script.


To install:

pip install git+

Running the example scripts requires:

  • installing jupyter notebook or jupyter lab
  • cloning the GLMsingle repository in order to get the example scripts located in examples:
pip install jupyterlab
git clone --recurse-submodules

Code dependencies: see requirements.txt


  • Currently, numpy has a 4GB limit for the pickle files it writes; thus, GLMsingle will crash if the file outputs exceed that size. One workaround is to turn off "disk saving" and instead get the outputs of GLMsingle in your workspace and save the outputs yourself to HDF5 format.

Example scripts

We provide a number of example scripts that demonstrate usage of GLMsingle. You can browse these example scripts here:

(Python Example 1 - event-related design)

(Python Example 2 - block design)

(MATLAB Example 1 - event-related design)

(MATLAB Example 2 - block design)

If you would like to run these example scripts, the Python versions are available in /GLMsingle/examples, and the MATLAB versions are available in /GLMsingle/matlab/examples.

The first two notebooks contain a full walkthrough of the process of loading an example dataset and design matrix, estimating neural responses using GLMsingle, estimating the reliability of responses at each voxel, and comparing those achieved via GLMsingle to those achieved using a baseline GLM.

The remaining notebooks illustrate a number of other analyses that may be useful for the user to browse.

Additional information

Terms of use: This content is licensed under a BSD 3-Clause License.

If you use GLMsingle in your research, please cite the following paper:

Change history

  • 2023/03/27 - More diagnostic figures added.
  • 2023/03/26 - A number of new useful diagnostics are computed: these include diagnostics of the design matrix (information is shown in the command window), new figure visualizations, and a new run-wise FIR model that is used to generate diagnostic figures. These changes are currently implemented in MATLAB and will be ported to Python soon. The changes are described in the function documentation and covered in the new video walkthrough of figure outputs (see above).
  • 2022/11/28 - Version 1.1 of GLMsingle is now released. A git tag has been added to the repo. This version corresponds to what is described in the Prince et al. 2022 paper.
  • 2021/10/12 - Version 1.0 of GLMsingle is now released. A git tag has been added to the repo.
  • 2021/05/21 - The core code is complete, but is in "beta" and we are generating tutorial examples of usage. The initial 1.0 release should be forthcoming.