Skip to main content

API reference

Datasets

Preprocessed fMRI datasets. Each class downloads what it needs on first use and returns data matrices in a chosen brain space.

dataset
Forrest The Forrest dataset.
Life The Life dataset.
Budapest The Budapest dataset.
SpaceTop
CamCAN
ID1000
HCA
IBC
HBNSSI

Spaces and templates

Geometry, masks, parcellations, morphometry, and mappings for the standard surface spaces (onavg, fsaverage) and MNI volume grids.

geometry Surface geometry.
mask Standard cortical mask.
mapping Get mapping (transform) from one space to another.
parcellation Group-based parcellation.
morphometry Group-based morphometry measure.
distances Distances between vertices.
smooth Get a smoothing matrix.
sls Get a list of vertex indices for searchlight analysis.
tpl Connectivity hyperalignment template.

Surfaces

Surface meshes, spheres, and surface alignment.

Surface
Sphere
Aligner Aligns a surface to a template using Procrustes analysis.

Analysis

Modeling, statistics, and benchmarking.

glm General linear model.
isc Compute inter-subject correlation (ISC) from data matrices.
pearsonr Pearson correlation coefficient.
classification Movie time point/segment classification accuracy.
stats.cronbach_alpha Cronbach’s alpha.
stats.cronbach_alpha_ci Confidence interval for Cronbach’s alpha.
stats.spearman_brown Spearman-Brown prediction formula.
stats.spearman_brown_inv Predicting required test length for a given reliability.
stats.noise_ceilings Noise ceilings.
stats.normalize Normalize the data to normal distribution.
linalg.safe_svd Singular value decomposition without occasional LinAlgError crashes.
linalg.safe_polar Polar decomposition without occasional LinAlgError crashes.
linalg.gram_pca Principal component analysis (PCA) based on the Gram matrix.
linalg.ensemble_lstsq Linear regression with k-fold bagging.
ensemble.kfold_bagging Generate train and test indices for k-fold bagging.
ensemble.kfold_bagging_groups Generate train and test indices for k-fold bagging with group constraints.
ensemble.permute_groups Generate permutations of group members.

Plotting

Render surface maps as 2D images.

plot
plot_mebrains
Image

Utilities

File I/O, result caching, and archiving.

load Load the file using the automatically determined function.
save Save the data using the automatically determined format.
record Run the function and save the returned output to file.
percentile
archive Create a lzma compressed tar file from a list of files and/or directories.
archive_check Check if the lzma file is correct by comparing it with the original files.
utils.monitor Monitors function execution and records running time and system information.
utils.parse_record Parse the timing information based on record.
utils.assert_sufficient_time Check if remaining SLURM walltime is sufficient.