nispace.nulls.generate_spins

nispace.nulls.generate_spins(parc, parc_space, n_perm=1000, method='original', seed=None, parc_hemi=None)[source]

Generate spin resampling indices for a surface parcellation.

Supports bilateral (tuple of two GiftiImages) and single-hemisphere (single GiftiImage) parcellations.

Returns a tuple (spins_lh, spins_rh) of int32 arrays. For bilateral parcellations both have shape (n_parcels_hemi, n_perm). For a single-hemisphere parcellation the unused hemisphere gets shape (0, n_perm). RH indices are local to [0, n_rh).