CanlabCore ships with a small collection of test datasets and exposes a much
larger registry of group-level images, parcellations, meta-analytic maps, and
multivariate "signature" patterns through the load_image_set function.
Together, these are the canonical inputs for tutorials, walkthroughs, and the
example scripts in CANlab_help_examples.
Most of the built-in test data lives in CanlabCore/Sample_datasets/ and
ships with the toolbox itself. The remaining datasets and patterns are loaded
on demand from the CANlab Neuroimaging_Pattern_Masks repository, the
MasksPrivate repository (lab-internal weight maps), the
canlab_single_trials
repository (single-trial pain datasets), or in some cases by automatic
download from Neurovault.
The central entry point is:
[image_obj, networknames, imagenames] = load_image_set('keyword');load_image_set resolves a keyword (e.g. 'emotionreg', 'nps', 'kragel18',
'bucknerlab') to the matching image set, returns an fmri_data object with
the maps loaded, a cell array of formatted network names suitable for plot
labels, and a cell array of full image filenames. If the input is not a
recognized keyword, it is treated as a list of NIfTI filenames and loaded
directly.
For a longer narrative walkthrough see the original CANlab documentation page
at https://canlab.github.io/_pages/canlab_help_2c_loading_datasets/canlab_help_2c_loading_datasets.html.
The keyword inventory has grown since that page was written, so the table
below reflects the current state of the registry from the live
load_image_set.m source. A few datasets — particularly newer signatures
such as pifonem, transcriptomic_gradients, and the Hansen22 PET maps —
are not described in the legacy help page.
The following test data ships with the CanlabCore repository under
CanlabCore/Sample_datasets/:
The registry is organized into four families, mirroring the :Available Keywords: block in the load_image_set.m header. Type the keyword (or any
listed alias) as the first argument to load_image_set. Keywords are matched
case-insensitively. Some entries require additional CANlab repositories or
private data on the MATLAB path (MasksPrivate,
Neuroimaging_Pattern_Masks, canlab_single_trials); a couple are
auto-downloaded from Neurovault.
Special meta-keywords:
'list'— returns a table of registered signatures (as the first output) and prints it.'all'— loads every signature in the registry (large object).
These keywords dispatch to load_<keyword>.m in the
canlab_single_trials
repository (compiled and maintained by Bogdan Petre). Each loads as an
fmri_data object whose .metadata_table field stores per-trial
information. The repository must be on your MATLAB path. The keyword
all_single_trials loads all of them.
Multivariate "signature" patterns are weight maps from peer-reviewed
predictive-modeling studies. Most are loaded by a single keyword and stored
either in the public Neuroimaging_Pattern_Masks repository or in the
private MasksPrivate repository (lab-internal). Convenience meta-keywords:
npsplus— NPS (NPSpos / NPSneg), SIIPS, PINES, Romantic Rejection, VPS, etc.painsig— NPS (NPSpos / NPSneg) and SIIPS only.fibromyalgia,fibro,fm— NPSp + FM-pain + FM-multisensory.all— load all registered signatures.
These examples are adapted from the :Examples: block in load_image_set.m.
imagenames = {'weights_NSF_grouppred_cvpcr.img' ... % NPS
'Rating_Weights_LOSO_2.nii' ... % PINES
'dpsp_rejection_vs_others_weights_final.nii' ... % rejection
'bmrk4_VPS_unthresholded.nii'}; % VPS
[obj, netnames, imgnames] = load_image_set(imagenames);
% Equivalent (and richer) one-liner using the npsplus keyword:
[obj, netnames, imgnames] = load_image_set('npsplus');% Load PLS signatures from Kragel et al. 2018
[obj, names] = load_image_set('pain_cog_emo');
bpls_wholebrain = get_wh_image(obj, [8 16 24]);
names_wholebrain = names([8 16 24]);
bpls_subregions = get_wh_image(obj, [1:6 9:14 17:22]);
names_subregions = names([1:6 9:14 17:22]);
% Load test data: emotion regulation contrasts (Wager et al. 2008)
test_data_obj = load_image_set('emotionreg');
% Compare the test data to each Kragel pattern
create_figure('Kragel Pain-Cog-Emo maps', 1, 2);
stats = image_similarity_plot(test_data_obj, 'average', 'mapset', ...
bpls_wholebrain, 'networknames', names_wholebrain, 'nofigure');
subplot(1, 2, 2)
stats = image_similarity_plot(test_data_obj, 'average', 'mapset', ...
bpls_subregions, 'networknames', names_subregions, 'nofigure');% Print and return the registry as a MATLAB table
sig_table = load_image_set('list');
% Load every registered signature into one fmri_data object
[obj, names] = load_image_set('all');- The original CANlab loading-datasets walkthrough: https://canlab.github.io/_pages/canlab_help_2c_loading_datasets/canlab_help_2c_loading_datasets.html
atlases_regions_and_patterns.md— the parallel registry on the atlas / region side, loaded viaload_atlas.Object_methods.md— index of object classes (fmri_data,atlas,region, etc.) and their methods.fmri_data_methods.md— functional index of@fmri_dataand@image_vectormethods organized by area.toolbox_folders.md— what lives in each subfolder ofCanlabCore/.