fmri_data methods, organized by area

May 7, 2026 · View on GitHub

This is a functional index of methods available on an fmri_data object. Many methods are inherited from image_vector (the superclass) and apply to its other subclasses (statistic_image, atlas, fmri_mask_image) too — the inheritance source is shown in the column. The on-disk organization is per-class (@fmri_data/, @image_vector/); this document is the cross-cutting functional view.

Type methods(my_obj) in MATLAB for the live list on any instance.

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
cat@fmri_dataConcatenate fmri_data objects along the image (4th) dim
horzcatboth[a, b] operator on objects, image-wise
split@fmri_dataSplit object into N subsets by image index
get_wh_image@image_vectorPick a subset of images by index
mean@image_vectorVoxel-wise mean across images
prctile@image_vectorVoxel-wise percentile across images
plus, minus, power@image_vectorElement-wise arithmetic on objects
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 → 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 (won't fully work in headless matlab -batch).

MethodFromOne-liner
plot@fmri_dataCustom multi-panel QC plot for an fmri_data object
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
riverplot@fmri_dataRiverplot visualization
wedge_plot_by_atlas@image_vectorPolar/wedge plot by atlas region
plot_current_orthviews_coord@image_vectorPrint MNI of current orthviews crosshair
saveplots@fmri_dataSave the current plots to disk

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_vectorGeneral interpolation in voxel space
compare_space@image_vectorDiagnostic: are two objects in the same space?
define_space_mapping@image_vectorBuild the mapping between two spaces
spm_coregister@fmri_dataWrapper around SPM's coregistration

Statistics

Voxel-wise inference, prediction, and multivariate analyses.

MethodFromOne-liner
ttest@fmri_dataVoxelwise one-sample t-test → statistic_image
signtest@fmri_dataVoxelwise non-parametric sign test
regress@fmri_dataVoxelwise multiple regression (uses obj.X)
robfit_parcelwise@fmri_dataRobust regression at parcel level
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
fitlme_voxelwise@fmri_dataVoxelwise mixed-effects model
rsa_regression@fmri_dataRepresentational-similarity regression
hrf_fit@fmri_dataHRF estimation per voxel
test_generalizability@fmri_dataCross-cohort generalization test
canlab_connectivity_preproc@fmri_dataConnectivity-prep pipeline (despike / nuisance / bandpass)

Multivariate prediction

MethodFromOne-liner
predict@fmri_dataCross-validated multivariate prediction
predict_test_suite@fmri_dataBattery of predict sanity checks
evaluate_spatial_scale@fmri_dataSpatial-scale evaluation for patterns
bootstrap_structure_coeff_diff@fmri_dataBootstrap diff in structure coefficients
structure_coefficient_map@fmri_dataPer-voxel structure coefficient map
structure_coefficients@fmri_dataStructure coefficients
get_model_encoding_map@fmri_dataEncoding map for a fitted model
model_brain_pathway@fmri_dataPathway-modeling on connectivity
model_mpathi@fmri_dataMulti-pathway model
dual_regression@fmri_dataDual regression on group ICA components

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
ttest_table_and_lateralization_test@fmri_dataCombined t-table + L/R lateralization test

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
annotate_binary_results_map@fmri_dataAnnotate a thresholded map with atlas/signature labels
annotate_continuous_neuroimage_maps@fmri_dataAnnotation for continuous (unthresholded) maps
neurosynth_feature_labels@fmri_dataLook up Neurosynth feature labels
neurosynth_lexical_plot@fmri_dataLexical plot of Neurosynth labels
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_atlas@image_vectorMean-or-pattern expression per atlas region
apply_parcellation@image_vectorMean-or-pattern expression per parcel
extract_roi_averagesbothAverage per contiguous region (or mask values)
extract_gray_white_csf@image_vectorMean + top-5 components in GM, WM, CSF
extract_measures_batch@fmri_dataBatch-extract multiple measures at once
get_xyzmm_coordinates@image_vectorVoxel indices → MNI mm coordinates
normalize_gm_by_wm_csf@fmri_dataNormalize GM signal by WM/CSF
runRestMetrics@fmri_dataResting-state derived metrics

Data processing

Workflows for transforming and processing data objects

| denoise_timeseries_pipeline | @fmri_data | End-to-end denoising for timeseries data | | preprocess | @image_vector | Many preprocessing options (filter / outliers / scale) | | rescale | @fmri_data | Per-image / per-voxel rescaling |

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
windsorize@fmri_dataVoxel-wise windsorization
sim_data@fmri_dataSimulate fmri_data for testing
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)
create@fmri_dataInternal helper to assemble fields into an object
unstack_by_condition@image_vectorSplit into sub-objects by a condition vector
validate_object@fmri_dataSanity-check internal invariants