Schematics indicate steps in spatial covariance computation and ENVI operation. Each COVET matrix characterizes a cell’s niche, comprising k nearest spatial neighbors, based on the shifted covariance of gene expression within the niche. Shifted covariance is calculated relative to mean expression in the sample, enabling meaningful comparison of niches. Distance between niches is determined by an efficient approximation of optimal transport. The COVET adjacency matrix, based on AOT as the spatial similarity metric, can be used directly for other downstream spatial analyses, such as dimensionality reduction and clustering, where cells are grouped together by similar environment rather than by expression.