nispace.nulls.apply_spins
- nispace.nulls.apply_spins(data_1d, spins_lh, spins_rh, idc_lh, idc_rh, n_perm=None)[source]
Apply precomputed spin indices to a 1D data array.
- Parameters:
data_1d (array-like) – 1D array of parcel values, length
n_parcels.spins_lh (ndarray of int) – Spin indices as returned by
generate_spins()/generate_baum_spins, shape(n_lh_parcels, n_perm)/(n_rh_parcels, n_perm).-1entries (Baum-method parcels absorbed by the medial wall after rotation) are handled by setting those output positions to NaN.spins_rh (ndarray of int) – Spin indices as returned by
generate_spins()/generate_baum_spins, shape(n_lh_parcels, n_perm)/(n_rh_parcels, n_perm).-1entries (Baum-method parcels absorbed by the medial wall after rotation) are handled by setting those output positions to NaN.idc_lh (array-like of int) – Positions in
data_1dcorresponding to each hemisphere’s parcels, in the same orderspins_lh/spins_rhindex into.idc_rh (array-like of int) – Positions in
data_1dcorresponding to each hemisphere’s parcels, in the same orderspins_lh/spins_rhindex into.n_perm (int, optional) – Number of permutations to apply; defaults to
spins_lh.shape[1](use all).
- Returns:
null_data – Shape
(n_perm, n_parcels). Positions not covered byidc_lh/idc_rh(e.g. subcortex) remain NaN.- Return type:
ndarray
Notes
Intended to be called through
generate_null_maps(), which calls this once per data row as part of its spin-test code path — not meant to be called directly in most cases.