Pipeline documentation
How a LaBGAS neuroimaging study goes from raw scanner output to a set of archived, date-stamped result reports. Each page below covers one stage: what it is for, what it consumes and produces, the canonical scripts involved, and where to read further.
Read the CANlab documentation first. These pages describe our layer. The object model, the methods, and most of the underlying machinery are CANlab’s, and are documented far more thoroughly at canlab.github.io: Setup · Interactive fMRI philosophy · Object & method docs · Walkthroughs · Batch system
Where a CANlab walkthrough already covers something, we link to it rather than restate it.
How the pipeline fits together
raw DICOM
│
├─ prep/ BIDS conversion → fMRIPrep → event timing files → smoothing
│
├─ firstlevel/ SPM + CANlab GLM per subject → contrast images → diagnostics
│
└─ secondlevel/ group inference, MVPA, signature responses
│
└─ CANlab batch system → date-stamped HTML reports
Everything upstream of secondlevel/ is owned by
LaBGAScore. Second-level analysis is a mix: the batch
machinery and reporting come from the
CANlab_help_examples fork, while the
multivariate pipelines (PLS-DA, PLSR, Elastic Net) are ours.
Working principles
A few conventions shape all of the below, and are worth knowing before you start.
Scripts are templates, not a library. LaBGAScore is copied into a study repository and
adapted. Numbered prefixes (s0, s1, s2 …) mark pipeline order. This keeps analysis code
versioned with the study it belongs to.
Reports are the deliverable. Analyses end in date-stamped HTML containing the figures, statistics and the code that produced them. The point is that a result can be traced back months later without re-running anything.
Data lives under version control. DataLad — built on git and git-annex — tracks both code and data, with code pushed to GitHub and data to GIN.
Analyses run on a shared Linux server, not on laptops.
Pages
| Stage | Page |
|---|---|
| Prerequisites, paths, conventions | Setup & dependencies |
| 1 · Raw data → BIDS → prepared inputs | BIDS conversion & prep |
| 2 · Subject-level GLM | First-level models |
| 3 · Group inference & reporting | Second-level analysis |
| Classification | PLS-DA |
| Continuous prediction | PLSR |
| Regularised regression | Elastic Net |
| Receptor and kinetic imaging | PET |
| Metabolite quantification | MR spectroscopy |
| Networks and representational similarity | Connectivity & RSA |
| Parcellations, masks, signatures | Atlases & masks |
These pages summarise the repository as it stood when they were written. For anything
operational — exact arguments, current script names — treat
the repository as the source of truth, and in particular
LaBGAS_fMRI_analysis_workflow.md,
which walks the fMRI workflow end to end and is maintained alongside the code it describes.