mne.random_parcellation#
- mne.random_parcellation(subject, n_parcel, hemi, subjects_dir=None, surface='white', *, rng=None, random_state=None)[source]#
Generate random cortex parcellation by growing labels.
This function generates a number of labels which don’t intersect and cover the whole surface. Regions are growing around randomly chosen seeds.
- Parameters:
- subject
str The FreeSurfer subject name.
- n_parcel
int Total number of cortical parcels.
- hemi
str Hemisphere id (ie
'lh','rh','both'). In the case of'both', both hemispheres are processed with(n_parcel // 2)parcels per hemisphere.- subjects_dirpath-like |
None The path to the directory containing the FreeSurfer subjects reconstructions. If
None, defaults to theSUBJECTS_DIRenvironment variable.- surface
str The surface along which to do the computations, defaults to
'white'(the gray-white matter boundary).- rng
None|int| instance ofGenerator|RandomState The random number generator (RNG). If
None(default), a newnumpy.random.Generatorseeded from entropy is used. Pass an int or anumpy.random.Generatorfor reproducible results, or a legacyRandomStateto control the random-number stream or for interoperability with third-party code such as scikit-learn that does not accept generators. An integer seed usesnumpy.random.default_rng()and therefore produces a different stream than the same integer passed to a legacyrandom_stateorseedparameter.New in v1.13.
- random_state
None|int| instance ofRandomState Supported for compatibility. New code should use
rng. IfNone, NumPy’s globalRandomStateis used.
- subject
- Returns: