mne.grow_labels

mne.grow_labels(subject, seeds, extents, hemis, subjects_dir=None, n_jobs=1, overlap=True, names=None, surface='white')[source]

Generate circular labels in source space with region growing.

This function generates a number of labels in source space by growing regions starting from the vertices defined in “seeds”. For each seed, a label is generated containing all vertices within a maximum geodesic distance on the white matter surface from the seed.

Note: “extents” and “hemis” can either be arrays with the same length as

seeds, which allows using a different extent and hemisphere for each label, or integers, in which case the same extent and hemisphere is used for each label.

Parameters
subjectstr

Name of the subject as in SUBJECTS_DIR.

seedsint | list

Seed, or list of seeds. Each seed can be either a vertex number or a list of vertex numbers.

extentsarray | float

Extents (radius in mm) of the labels.

hemisarray | int

Hemispheres to use for the labels (0: left, 1: right).

subjects_dirstr

Path to SUBJECTS_DIR if not set in the environment.

n_jobsint

The number of jobs to run in parallel (default 1). Requires the joblib package. Likely only useful if tens or hundreds of labels are being expanded simultaneously. Does not apply with overlap=False.

overlapbool

Produce overlapping labels. If True (default), the resulting labels can be overlapping. If False, each label will be grown one step at a time, and occupied territory will not be invaded.

namesNone | list of str

Assign names to the new labels (list needs to have the same length as seeds).

surfacestr

The surface used to grow the labels, defaults to the white surface.

Returns
labelslist of Label

The labels’ comment attribute contains information on the seed vertex and extent; the values attribute contains distance from the seed in millimeters