Learn how to use nltools through hands-on examples. Start with the Basics to understand core data structures, then explore Workflows for complete analysis pipelines.
Each tutorial runs end-to-end and shows its outputs inline. Every page is rendered from a marimo notebook under docs/tutorials/ — download the .py and open it with uvx marimo edit --sandbox <notebook>.py to run and edit every cell yourself.
Basics¶
These tutorials introduce the four core data classes in nltools. Each one covers creation, manipulation, and common operations.
Loading neuroimaging data, basic operations (indexing, slicing, arithmetic), and summary statistics.
Creating design matrices, building task regressors, HRF convolution, and nuisance covariates.
Creating Adjacency objects, square vs. vector forms, thresholding, and binarizing matrices.
A parallel, memory-efficient iterator of BrainData: per-subject operations in parallel, path-backed caching, and group reductions across subjects.
Workflows¶
End-to-end analysis workflows that demonstrate how nltools classes and functions work together for real neuroimaging analyses.
First- and second-level GLM: build designs, fit models, compute contrasts, and run group statistics with multiple-comparisons correction.
Predict brain activity from stimulus features with an FIR feature bank and ridge regression, scored by cross-validated R².
Decoding and RSA across whole-brain, ROI, and searchlight scales.
Shared, time-locked responses to naturalistic movies, measured across subjects.
Learning Resources¶
Dartbrains¶
A fundamentals of neuroimaging undergraduate level course
Naturalistic Data¶
A more advanced neuroimaging course for working with naturalistic datasets (e.g. watching movies, playing games, etc).
Discourse Community¶
A Stack Overflow like forum where you can view, contribute, and vote on FAQs regarding nltools. Please ask questions here first so that other users can benefit from the answers!