mne.label.select_sources¶
-
mne.label.
select_sources
(subject, label, location='center', extent=0.0, grow_outside=True, subjects_dir=None, name=None, random_state=None, surf='white')[source]¶ Select sources from a label.
- Parameters
- subject
str
Name of the subject as in SUBJECTS_DIR.
- labelinstance of
Label
|str
Define where the seed will be chosen. If str, can be ‘lh’ or ‘rh’, which correspond to left or right hemisphere, respectively.
- location‘random’ | ‘center’ |
int
Location to grow label from. If the location is an int, it represents the vertex number in the corresponding label. If it is a str, it can be either ‘random’ or ‘center’.
- extent
float
Extents (radius in mm) of the labels, i.e. maximum geodesic distance on the white matter surface from the seed. If 0, the resulting label will contain only one vertex.
- grow_outsidebool
Let the region grow outside the original label where location was defined.
- subjects_dir
str
|None
The path to the freesurfer subjects reconstructions. It corresponds to Freesurfer environment variable SUBJECTS_DIR.
- name
None
|str
Assign name to the new label.
- random_state
None
|int
| instance ofRandomState
If
random_state
is anint
, it will be used as a seed forRandomState
. IfNone
, the seed will be obtained from the operating system (seeRandomState
for details). Default isNone
.- surf
str
The surface used to simulated the label, defaults to the white surface.
- subject
- Returns
- labelinstance of
Label
The label that contains the selected sources.
- labelinstance of
Notes
This function selects a region of interest on the cortical surface based on a label (or a hemisphere). The sources are selected by growing a region around a seed which is selected randomly, is the center of the label, or is a specific vertex. The selected vertices can extend beyond the initial provided label. This can be prevented by setting grow_outside to False.
The selected sources are returned in the form of a new Label object. The values of the label contain the distance from the seed in millimeters.
New in version 0.18.