image_vector methods, organized by area

May 7, 2026 ยท View on GitHub

This is a functional index of methods available on an image_vector object. image_vector is the superclass for the CANlab neuroimaging-data classes (fmri_data, statistic_image, atlas, fmri_mask_image); you will rarely create an image_vector directly. The methods listed here are inherited by all of those subclasses, and most appear with From: @image_vector in fmri_data_methods.md.

image_vector stores brain image data in a flat (2-D) voxels x images matrix together with the meta-data (volInfo) needed to round-trip back to 3-D image space. It supports image math, masking, resampling, visualization, statistics, multivariate prediction, region/atlas extraction, and I/O. Type methods(my_obj) in MATLAB for the live list on any instance.

Properties

PropertyDescription
source_notesFree-text notes about the data source
datImage data, a [voxels x images] single-precision matrix
dat_descripString description of the dataset
volInfoBrain mask + voxel-to-world mapping (mat, xyzlist, cluster)
removed_voxelsLogical vector of empty in-mask voxels removed (saves space; see remove_empty/replace_empty)
removed_imagesLogical vector of images removed (saves space; see remove_empty/replace_empty)
image_namesList of image names loaded into the object, no paths
fullpathList of image names with full paths; used by write
files_existLogical vector: do files in fullpath exist on disk?
historyCell array history of object processing, for provenance

Basic image math and operations

Combining images, set-like operations, voxel-level arithmetic, and the "removed/replaced empty" state machine that several methods rely on.

MethodFromOne-liner
get_wh_image@image_vectorPick a subset of images by index
mean@image_vectorVoxel-wise mean across images
prctile@image_vectorVoxel-wise percentile thresholds across images
image_math@image_vectorGeneral Boolean / arithmetic between objects
union@image_vectorUnion/intersection masks for two objects
flip@image_vectorL-R flip of all images in the object
trim_mask@image_vectorDrop empty/zero rows from .dat
select_voxels_by_value@image_vectorKeep voxels whose value matches a predicate
winnerTakeAll@image_vectorPer-voxel argmax across images
replace_empty@image_vectorRe-expand .dat to full padded voxel space
remove_empty@image_vectorCompress .dat by dropping empty voxels
reparse_contiguous@image_vectorRecompute contiguous-voxel groupings
rebuild_volinfo_from_dat@image_vectorReconstruct volInfo from .dat (recovery)
reconstruct_image@image_vector2-D .dat to 3-D / 4-D MATLAB array
expand_into_atlas_subregions@image_vectorReplicate into atlas-defined subregions
subdivide_by_atlas@image_vectorSplit into sub-objects, one per atlas region

Display and visualization

Most of these create a figure or modify an existing fmridisplay. Many require a graphics environment.

MethodFromOne-liner
histogram@image_vectorHistogram of .dat values, per image
montage@image_vectorSlice montage on canonical anatomy
slices@image_vectorOne-slice-per-image montage
display_slices@image_vector3-pane (ax/cor/sag) compact slice view
slice_movie@image_vectorMovie of slices through the volume
rmssd_movie@image_vectorMovie of frame-to-frame RMSSD
orthviews@image_vectorSPM-style orthviews (requires SPM graphics)
surface@image_vectorRender on cortical surface
render_on_surface@image_vectorLower-level surface render with options
render_on_cerebellar_flatmap@image_vectorCerebellar SUIT flatmap rendering
isosurface@image_vector3-D isosurface from voxel volume
pattern_surf_plot_mip@image_vectorAxial maximum-intensity-projection surface
wedge_plot_by_atlas@image_vectorPolar/wedge plot by atlas region
plot_current_orthviews_coord@image_vectorPrint MNI of current orthviews crosshair

Resampling and interpolation

Anything that changes the voxel grid or compares grids.

MethodFromOne-liner
resample_space@image_vectorResample to another object's space
resample_space_simple_reference@image_vectorSimpler resampling against a reference
resample_time@image_vectorResample / interpolate along the image (time) axis
interpolate@image_vectorFill missing values via 3-D linear interpolation
compare_space@image_vectorDiagnostic: are two objects in the same space?
define_space_mapping@image_vectorBuild the mapping between two spaces

Statistics

Voxel-wise inference, prediction, and multivariate analyses.

MethodFromOne-liner
searchlight@image_vectorSpherical-searchlight prediction/classification
searchlightLukas@image_vectorVariant of searchlight
ica@image_vectorSpatial ICA
pca@image_vectorSpatial PCA
mahal@image_vectorMahalanobis distance per image vs. set

Tables

Producing tabular reports from images and stat maps.

MethodFromOne-liner
table@image_vectorAtlas-labeled table of regions in a stat map
table_of_atlas_regions_covered@image_vectorCoverage table against an atlas
print_publication_table@image_vectorPre-formatted publication-style results table

Annotation with spatial similarity

Comparing images or regions to reference atlases / signatures / meta-analytic maps for interpretation.

MethodFromOne-liner
image_similarity_plot@image_vectorCosine/correlation similarity vs. a basis set
image_similarity_plot_bucknermaps@image_vectorConvenience wrapper for Buckner-network maps
hansen_neurotransmitter_maps@image_vectorHansen neurotransmitter map similarity

Data extraction

Pulling values out of images, by mask / atlas / parcellation / coordinate.

MethodFromOne-liner
apply_mask@image_vectorRestrict object to voxels in a mask
apply_parcellation@image_vectorMean-or-pattern expression per parcel
extract_roi_averages@image_vectorAverage per contiguous region (or mask values)
extract_gray_white_csf@image_vectorMean + top-5 components in GM, WM, CSF
get_xyzmm_coordinates@image_vectorIn-mask voxel indices to MNI mm coordinates

Data processing

Workflows for transforming and processing data objects.

MethodFromOne-liner
preprocess@image_vectorMany preprocessing options (filter / outliers / scale)

Quality control

Diagnosing and cleaning a dataset before analysis.

MethodFromOne-liner
descriptives@image_vectorPrint summary stats for the dataset
qc_metrics_second_level@image_vectorQC metrics across a 2nd-level set
outliers@image_vectorDetect outlier images
outliers_xval@image_vectorOutlier detection with cross-validated threshold
jackknife_similarity@image_vectorLeave-one-out spatial similarity

Misc utilities

I/O, type management, provenance, threshold helpers.

MethodFromOne-liner
write@image_vectorWrite .dat back to NIfTI / Analyze on disk
read_from_file@image_vectorRe-read pixel data from .fullpath into .dat
check_image_filenames@image_vectorValidate .fullpath entries exist on disk
enforce_variable_types@image_vectorCast .dat and friends to canonical types
history@image_vectorShow the .history provenance log
isempty@image_vectorTrue iff .dat is empty
threshold@image_vectorThreshold values (typically used on statistic_image)
unstack_by_condition@image_vectorSplit into sub-objects by a condition vector