atlas methods, organized by area

June 24, 2026 · View on GitHub

The atlas class is a CANlab data class for brain atlases and parcellations. It is a subclass of image_vector (via fmri_data), so an atlas object behaves like an image-vector object with extra fields and methods specifically designed for region-labeled / probabilistic parcellations. The integer parcel-index volume is stored in .dat (one integer per voxel), voxels-by-regions probability maps live in .probability_maps, and per-region text labels (with optional hierarchical levels and long-form descriptions) live in .labels, .labels_2....labels_5, and .label_descriptions.

In addition to the methods listed below, atlas inherits all fmri_data and image_vector methods (see fmri_data_methods.md and image_vector_methods.md). That means standard operations such as montage, surface, apply_mask, write, descriptives, flip, image_similarity_plot, image_math, resample_space, extract_roi_averages, etc. are all available on atlas objects too. Only methods that override or are unique to @atlas/ are documented here in detail. Use methods(my_atlas) in MATLAB for the live list; load_atlas returns named atlases distributed with CANlab.

Quick example

Render the 489-region CANlab2024 cortical/subcortical atlas as a 3-D isosurface, then a slice montage:

obj = load_atlas('canlab2024');
create_figure('fig'); isosurface(obj);
view(135, 30); lightFollowView;
create_figure('fig2');  axis off; montage(obj);

atlas_methods sample

Properties

atlas inherits all image_vector and fmri_data properties (e.g., .dat, .volInfo, .history, .image_names, .fullpath, etc.). The properties defined on the atlas class itself are:

PropertyDescription
atlas_nameShort description or name of the atlas
probability_mapsVoxels x regions matrix of probability values for each region (sparse)
labelsCell array of text strings, one per region (primary labels)
label_descriptionsRegions x 1 cell array of long-form descriptions
labels_2Optional secondary label cell array (e.g., coarser parcellation)
labels_3Optional tertiary label cell array
labels_4Optional quaternary label cell array
labels_5Optional quinary label cell array
referencesString matrix of associated publications
space_descriptionDescription of atlas space/template (e.g., MNI152NLin2009cAsym); used by render_on_surface for automatic surface projection
property_descriptionsInternal cell array of human-readable descriptions for each property (legacy / introspection)
additional_infoFree-form struct for attaching arbitrary metadata (legacy / extension slot)

Note: dat (inherited from image_vector) holds an integer vector with one parcel index per voxel for atlas objects; this is enforced by check_properties.

Basic image math and operations

Combining atlases, splitting / merging regions, and reshaping the parcellation.

MethodFromOne-liner
horzcat@atlas[a, b] operator on atlas objects (sequential merge_atlases)
merge_atlases@atlasAdd regions from one atlas to another, with replace/no-replace options
remove_atlas_region@atlasRemove region(s) by name or integer index
reorder_atlas_regions@atlasReorder atlas regions, optionally grouping by label patterns
select_atlas_subset@atlasSelect a subset of regions by name or integer code
split_atlas_by_hemisphere@atlasDivide bilateral regions into separate L and R regions
split_atlas_into_contiguous_regions@atlasSplit each labeled region into separate contiguous blobs
downsample_parcellation@atlasRemap to a coarser nested parcellation using labels_2...labels_5
probability_maps_to_region_index@atlasRebuild integer index .dat from .probability_maps (winner-take-all)
assign_vals@atlasAssign numeric values to regions and produce an fmri_data object
parcel_data2fmri_data@atlasExpand parcel-wise values into a voxelwise fmri_data object
parcel_stats2statistic_image@atlasExpand parcel-wise t / p / dfe into a voxelwise statistic_image

Display and visualization

MethodFromOne-liner
montage@atlasDisplay atlas regions on a standard slice montage (forwards to region/montage)
isosurface@atlasRender each atlas region as a colored 3-D isosurface

Interactive viewers (stand-alone functions, not class methods): an atlas object can be displayed in — and serves as the region-label source for — both interactive viewers. canlab_orthviews(atl) opens an enhanced SPM-style three-plane viewer in MATLAB that names the region under the crosshair (attach to any display with canlab_orthviews('AddAtlasLabel', atl)); canlab_niivue(atl) writes a portable web viewer (NiiVue) with the same crosshair region readout and a single-region outline/shade highlight.

Statistics

MethodFromOne-liner
atlas_similarity@atlasAnnotate atlas regions with labels + Dice / coverage stats from a reference atlas
match_atlas_labels@atlasPer-region Dice coefficients and best-match labels against another atlas

Tables

MethodFromOne-liner
label_table@atlasBuild a MATLAB table from the atlas's label / description fields

Data extraction

MethodFromOne-liner
extract_data@atlasAtlas-wise parcel means and local pattern responses from an fmri_data object
atlas_get_probability_maps@atlasReturn probability maps (or indicator maps) as an fmri_data object
get_region_volumes@atlasPer-region volume in mm^3 and raw voxel counts
num_regions@atlasTotal regions, regions with data, and any missing region indices
find_closest_region@atlasFind the closest atlas region to a given [x y z] mm coordinate
get_regions_at_crosshairs@atlasAtlas labels at the current SPM orthviews crosshair
select_regions_near_crosshairs@atlasSelect regions within X mm of the SPM orthviews crosshair
atlas2region@atlasConvert an atlas object to a region object

Data processing

Workflows for transforming and labeling atlas objects.

MethodFromOne-liner
threshold@atlasThreshold atlas regions based on values in .probability_maps
atlas_add_L_R_to_labels@atlasStandardize lateralization suffixes (_L/_R) on atlas labels

Misc utilities

MethodFromOne-liner
create@atlasInternal helper to populate atlas fields from name/value pairs (used by constructor)
check_properties@atlasValidate / cast atlas fields and (optionally) compress the index

Inherited methods

atlas also inherits all fmri_data and image_vector methods (see fmri_data_methods.md and image_vector_methods.md). Commonly used inherited methods on atlas objects include apply_mask, apply_atlas, apply_parcellation, extract_roi_averages, resample_space, write, descriptives, flip, image_similarity_plot, image_math, surface, render_on_surface, and orthviews.