mne.simulation.select_source_in_label#
- mne.simulation.select_source_in_label(src, label, location='random', subject=None, subjects_dir=None, surf='sphere', *, rng=None, random_state=None)[source]#
Select source positions using a label.
- Parameters:
- src
listofdict The source space.
- label
Label The label.
- location
str The label location to choose. Can be ‘random’ (default) or ‘center’ to use
mne.Label.center_of_mass()(restricting to vertices both in the label and in the source space). Note that for ‘center’ mode the label values are used as weights.New in v0.13.
- subject
str|None The subject the label is defined for. Only used with
location='center'.New in v0.13.
- subjects_dirpath-like |
None The path to the directory containing the FreeSurfer subjects reconstructions. If
None, defaults to theSUBJECTS_DIRenvironment variable.New in v0.13.
- surf
str The surface to use for Euclidean distance center of mass finding. The default here is “sphere”, which finds the center of mass on the spherical surface to help avoid potential issues with cortical folding.
New in v0.13.
- 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.
- src
- Returns: