nispace.nulls.correlate_hemis_parc
- nispace.nulls.correlate_hemis_parc(data, parc_idc_lh=None, parc_idc_rh=None, rank=False)[source]
Per-row left/right-hemisphere correlation of parcellated data.
Plain numpy, using
nispace.stats.coloc.corr()(not numba itself, but the underlying corr call is numba-jitted). Not currently called anywhere in NiSpace (dead code) — kept as a standalone diagnostic utility, e.g. for sanity-checking left-right symmetry of a map.- Parameters:
data (array-like) – 1D (single map) or 2D (
n_maps, n_parcels) parcellated data; 1D input is treated as a single row.parc_idc_lh (array-like of int, optional) – Column positions belonging to the left/right hemisphere. Default: split the columns into two equal halves.
parc_idc_rh (array-like of int, optional) – Column positions belonging to the left/right hemisphere. Default: split the columns into two equal halves.
rank (bool, default=False) – Rank-transform before correlating (Spearman instead of Pearson).
- Returns:
Shape
(n_maps,); per-row LH-RH correlation. NaN pairs are excluded per row; rows with fewer than 2 valid pairs or zero variance in either hemisphere give NaN.- Return type:
np.ndarray