region methods, organized by area

May 7, 2026 ยท View on GitHub

This is a functional index of methods available on a region object. A region is a class for groups of voxels defined as anatomical or functional regions (contiguous voxels above a threshold in an analysis, parcels from an atlas, etc.). The class replaces the older clusters struct from the scnlab toolbox; the class definition adds error checking and structured methods (visualization, tabling, conversion to other image types).

region is a standalone class (not a subclass of image_vector), so it does NOT inherit image_vector methods. Instead, several region methods convert to and from image_vector / fmri_data / atlas so that those classes' tooling can be applied. Type methods(my_obj) in MATLAB for the live list on any instance.

Properties

PropertyDescription
titleTitle of the region object
shorttitleShort title (used as label)
descrip1Description string 1
descrip2Description string 2 (lists key methods)
XYZ[3 x voxels] voxel coordinates within the region
XYZmm[3 x voxels] world (mm) coordinates within the region
valPer-voxel values (typically the input mask values)
val_descripDescription of values stored in val
ZPer-voxel max-stat / Z-scores (legacy field, still widely used)
Z_descripDescription of values stored in Z (legacy)
threshold(legacy) Threshold associated with the region, kept for compatibility
voxSizeVoxel size in mm (3-vector from the affine)
MAffine matrix (4x4) inherited from the source mask
dimImage dimensions (3-vector)
numVoxNumber of voxels in the region
numpeaksNumber of peaks within the region
centerVoxel-coordinate center of mass
mm_centermm-coordinate center of mass
timeseriesPer-region timeseries (if extracted)
contrastdataPer-region contrast data (if extracted)
datPer-region averaged data (images x 1 vector when extracted)
all_dataFull per-voxel data extracted from a source image set
source_imagesFilenames of images data were extracted from
custom_info1Custom info slot 1 (often the source mask filename)
custom_info1_descripDescription for custom_info1
custom_info2Custom info slot 2
custom_info2_descripDescription for custom_info2

Basic image math and operations

MethodFromOne-liner
merge@regionMerge two or more regions into one, combining fields appropriately
posneg_separate@regionSplit regions into positive- and negative-valued sub-regions
subdivide_by_atlas@regionSubdivide each blob by anatomical atlas parcels
subdivide_by_local_max@regionSubdivide regions by local peak Z-score / maxima
reparse_continguous@regionRe-define regions based on contiguous blobs (note: spelling is continguous in source)
select_coordinates_near_regions@regionFilter MNI mm coordinates by minimum distance to the region object

Display and visualization

MethodFromOne-liner
montage@regionSlice montage of region object on canonical anatomy
orthviews@regionSPM orthviews via cluster_orthviews with hot/cool colormap
surface@regionRender region blobs on cutaway / canonical surfaces
isosurface@regionOne 3-D isosurface per region, with optional L/R color matching
labelled_surface@regionTransparent isosurfaces with centroid labels and text annotations
match_colors_left_right@regionAssign matched colors to symmetric L/R regions

Tables

MethodFromOne-liner
table@regionPrint and return a labeled table of all regions (positive and negative)
table_simple@regionSimple one-row-per-region results table (useful after atlas subdivision)
table_of_atlas_regions_covered@regionTabulate atlas parcels covered by the regions
ttest_table_by_condition@regionPer-region means + stats tables for an fmri_data object across conditions
autolabel_regions_using_atlas@regionAuto-label regions using an atlas object

Data extraction

MethodFromOne-liner
extract_data@regionExtract data and apply local patterns from an image_vector for the region's voxels
check_extracted_data@regionVerify region-average data via re-extraction from source images

Misc utilities

Conversion to and from other CANlab object classes, and basic predicates.

MethodFromOne-liner
region2atlas@regionConvert a region object to an atlas object
region2fmri_data@regionConvert a region object to an fmri_data object
region2imagevec@regionConvert a region object to an image_vector object
region2struct@regionConvert a region object to a plain MATLAB struct array (legacy compatibility)
isempty@regionTrue iff region array is empty or its first XYZ is empty