cogpy.measures.spatial

Spatial signal measures for 2D electrode grids.

Status

STATUS: ACTIVE Reason: Spatial characterization measures for iEEG grid recordings. Superseded by: n/a Safe to remove: no

Grid convention:

grid : (…, AP, ML) — AP rows, ML columns Batch dims (time, freq, etc.) are leading; spatial axes are always last. Scalar measures reduce (AP, ML) → scalar, so output shape is (…). 2D input returns a Python float for backward compatibility.

Functions

csd_power(grid_signal, *[, spacing_mm, axis])

Current Source Density (CSD) via 2D Laplacian of surface potential.

gradient_anisotropy(grid)

Gradient anisotropy ratio for a spatial grid.

marginal_energy_outlier(grid, *[, robust, ...])

Row and column energy outlier scores for a spatial grid.

moran_i(grid, *[, adjacency])

Moran's I spatial autocorrelation for a scalar grid map.

spatial_coherence_profile(grid_signal, fs, *)

Mean coherence as a function of inter-electrode distance.

spatial_kurtosis(grid)

Excess kurtosis of the spatial amplitude distribution.

spatial_noise_concentration(grid, *[, k])

Fraction of total grid energy in the top-k electrodes.

spatial_summary_xr(da, *[, measures, ...])

Compute scalar spatial summaries preserving non-spatial coords.