Tools
Everything we use to analyse our data is developed in the open at github.com/labgas. Two repositories hold the reusable methods; the rest are study-specific code released alongside papers.
Built on CANlab tools. Our neuroimaging code is a layer on top of the toolset developed by the Cognitive and Affective Neuroscience Lab (CANlab), not a replacement for it. Nothing here runs without CanlabCore and Neuroimaging_Pattern_Masks on the MATLAB path, alongside SPM12.
If you are new to this ecosystem, read the CANlab material first — the setup guide, the object-oriented analysis philosophy, the object and method docs, and the walkthroughs. Our pipeline documentation assumes it.
Who owns which layer
It is worth being explicit about where the boundary sits, because the two codebases are used together constantly.
| Layer | Provided by | What it covers |
|---|---|---|
| Object model and core methods | CANlab — CanlabCore | fmri_data, statistic_image, atlas, fmri_model and friends; plotting, thresholding, predictive modelling machinery |
| Brain masks, atlases, signatures | CANlab — Neuroimaging_Pattern_Masks | Published multivariate signatures (NPS, SIIPS, PINES …), parcellations, region masks |
| Second-level batch pipeline & HTML reporting | CANlab, extended in our fork — CANlab_help_examples | prep_* and z_batch_* scripts, date-stamped report collections |
| Study initialisation, BIDS prep, first-level modelling | LaBGAS — LaBGAScore | Directory conventions, BIDS conversion, event timing, SPM first-level specification and diagnostics |
| PLS-DA / PLSR / Elastic Net neuroimaging pipelines | LaBGAS — LaBGAScore | secondlevel/ classes, functions and scripts with their own usage guides |
| PET, MRS, connectivity, receptor mapping | LaBGAS — LaBGAScore | Wrappers around Osprey, CoSMoMVPA, The Decoding Toolbox, GraphVar, JuSpace |
LaBGAScore
github.com/labgas/LaBGAScore · MATLAB · GPL-3.0
The core scripts — and templates for them — implementing our standard neuroimaging workflow. The repository is deliberately not a toolbox you add to your path and call. The scripts are canonical examples meant to be copied into a study-specific repository and adapted there, which keeps every project’s analysis code versioned with that project rather than drifting against a shared library.
Scripts carry numbered prefixes (s0, s1, s2 …) marking the order of the pipeline stages.
| Folder | Purpose |
|---|---|
prep/ |
BIDS conversion, directory definition, event timing files, smoothing |
firstlevel/ |
SPM + CANlab GLM specification, estimation, diagnostic reports |
secondlevel/ |
Group statistics and the MVPA/machine-learning pipelines, with seven usage guides |
stats_tools/ |
FDR correction and related helpers in functions/, plus sas_macros/ — SAS macros for effect sizes on the fixed effects of a PROC MIXED model |
atlas_mask_tools/ |
Atlas and mask generation, plus ready-made brain templates |
pet/ |
PET workflows including kinetic modelling |
mrs/ |
MR spectroscopy, built on Osprey |
cosmomvpa/ |
Representational similarity analysis via CoSMoMVPA |
decoding_toolbox/ |
Classification accuracy via The Decoding Toolbox |
graphvar/ |
Connectivity analysis inputs for GraphVar |
juspace/ |
Receptor–spatial correlation via JuSpace |
power/ |
Power analysis helpers |
figures/ |
Plotting utilities |
clean/ |
Housekeeping |
A static-analysis helper, LaBGAScore_check_all_scripts.m, runs MATLAB’s Code Analyzer across
every file in the repository. It catches syntax problems, but not undefined variables or logic
errors — code review is still required.
CANlab_help_examples (LaBGAS fork)
github.com/labgas/CANlab_help_examples · forked from canlab/CANlab_help_examples
Carries the batch pipeline for second-level analysis, in
Second_level_analysis_template_scripts/. Its design philosophy is worth stating because it
shapes how we work: interactive analysis using well-vetted, readable code, producing
date-stamped HTML reports with figures and statistics that are archived as a durable record
of what was run and when.
The workflow runs in five steps: create the analysis folder and run setup → edit the study
configuration files (paths, conditions, contrasts, behavioural data) → load images into
fmri_data objects and compute contrasts → run on-demand results scripts → run the
z_batch_* publishing scripts to generate the report collection.
See the second-level documentation and the CANlab batch system pages.
Dependencies
Installed separately and added to the MATLAB path:
Required — CanlabCore, Neuroimaging_Pattern_Masks, SPM12, MATLAB with the Statistics and Machine Learning and Signal Processing toolboxes.
Per-domain — CoSMoMVPA, The Decoding Toolbox, GraphVar, JuSpace, Osprey.
Preprocessing and data management — fMRIPrep, BIDS, DataLad with GIN for data hosting.
Start with Setup & dependencies.
All repositories
Methods
| Repository | Language | Description |
|---|---|---|
LaBGAScore |
MATLAB | Core scripts and templates for the LaBGAS standard neuroimaging workflow: BIDS conversion, first-level modelling, second-level and MVPA pipelines, PET, MRS, atlases and auxiliary toolkits. |
CANlab_help_examples |
HTML | LaBGAS fork of the CANlab help repository — how-to examples and the batch pipeline used for second-level neuroimaging analysis and date-stamped HTML reporting. |
Study code
Code — and in some cases data — released alongside specific projects and papers.
| Repository | Language | Description |
|---|---|---|
proj_threat_esophagus |
SAS | FWO post-doc project on the impact of threat on esophageal symptom perception. |
proj_bodymaps_IBS |
MATLAB | Bodily maps of emotions in irritable bowel syndrome. |
proj_pfi-x |
SAS | Data and code for the polyfoodintake-xylitol project. |
van_den_houte_fatigue_senior_postdoc_FWO |
FWO senior post-doctoral project on fatigue perception. | |
proj_erythritol_2 |
SAS | FWO-SNSF erythritol project, work package 2 — data and code. |
proj_erythritol_4a_code |
MATLAB | FWO-SNSF erythritol project, work package 4a — code subdataset. |
proj_bitter-reward-code |
MATLAB | Bitter tastant administration and reward sensitivity. |
proj_ncgs |
SAS | Non-coeliac gluten sensitivity gluten-challenge study analyses. |
proj_erythritol_4b-code |
MATLAB | FWO-SNSF erythritol project, work package 4b — code subdataset. |
proj_erythritol_5 |
SAS | FWO-SNSF erythritol project, work package 5. |
proj_reflux_database_1 |
SAS | Psychological and physiological contributors to symptom severity in refractory reflux. |
proj_erythritol_1 |
SAS | FWO-SNSF erythritol project, work package 1 — data and code. |
proj_reflux_database_2 |
SAS | Psychological factors across the organic-functional GERD spectrum. |
proj_CFS_treatment |
SAS | Chronic fatigue syndrome treatment-response analyses. |
proj_Rome_IV_network_analysis |
R | Network analysis of the Rome IV global epidemiology survey. |
dalile_junior_postdoc_FWO |
FWO junior post-doctoral project on short-chain fatty acids. | |
proj-emosymp |
MATLAB | fMRI study of emotion-induced somatic symptoms in healthy controls and functional somatic syndrome patients. |
proj-fodmap-fmri |
SAS | FODMAP-induced gut-brain axis dysfunction in IBS. |
proj-IBS-somatization |
MATLAB | Graph-theoretical measures on brain connectivity data in IBS. |
proj_discoverie_code |
DISCOvERIE H2020 project, work package 4 — code subdataset. | |
proj-whiplash |
MATLAB | fMRI study of neck pain-inducing movements. |
proj-sert-fmri |
MATLAB | Emotional modulation of esophageal pain. |
This index was compiled on 2026-09-02. The organisation page at github.com/labgas is always authoritative.