MCPcopy
hub / github.com/mne-tools/mne-python / grow_labels

Function grow_labels

mne/label.py:1719–1875  ·  view source on GitHub ↗

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 o

(
    subject,
    seeds,
    extents,
    hemis,
    subjects_dir=None,
    n_jobs=None,
    overlap=True,
    names=None,
    surface="white",
    colors=None,
)

Source from the content-addressed store, hash-verified

1717
1718@fill_doc
1719def grow_labels(
1720 subject,
1721 seeds,
1722 extents,
1723 hemis,
1724 subjects_dir=None,
1725 n_jobs=None,
1726 overlap=True,
1727 names=None,
1728 surface="white",
1729 colors=None,
1730):
1731 """Generate circular labels in source space with region growing.
1732
1733 This function generates a number of labels in source space by growing
1734 regions starting from the vertices defined in "seeds". For each seed, a
1735 label is generated containing all vertices within a maximum geodesic
1736 distance on the white matter surface from the seed.
1737
1738 Parameters
1739 ----------
1740 %(subject)s
1741 seeds : int | list
1742 Seed, or list of seeds. Each seed can be either a vertex number or
1743 a list of vertex numbers.
1744 extents : array | float
1745 Extents (radius in mm) of the labels.
1746 hemis : array | int
1747 Hemispheres to use for the labels (0: left, 1: right).
1748 %(subjects_dir)s
1749 %(n_jobs)s
1750 Likely only useful if tens or hundreds of labels are being expanded
1751 simultaneously. Does not apply with ``overlap=False``.
1752 overlap : bool
1753 Produce overlapping labels. If True (default), the resulting labels
1754 can be overlapping. If False, each label will be grown one step at a
1755 time, and occupied territory will not be invaded.
1756 names : None | list of str
1757 Assign names to the new labels (list needs to have the same length as
1758 seeds).
1759 %(surface)s
1760 colors : array, shape (n, 4) or (, 4) | None
1761 How to assign colors to each label. If None then unique colors will be
1762 chosen automatically (default), otherwise colors will be broadcast
1763 from the array. The first three values will be interpreted as RGB
1764 colors and the fourth column as the alpha value (commonly 1).
1765
1766 Returns
1767 -------
1768 labels : list of Label
1769 The labels' ``comment`` attribute contains information on the seed
1770 vertex and extent; the ``values`` attribute contains distance from the
1771 seed in millimeters.
1772
1773 Notes
1774 -----
1775 "extents" and "hemis" can either be arrays with the same length as
1776 seeds, which allows using a different extent and hemisphere for

Callers 2

test_grow_labelsFunction · 0.90
select_sourcesFunction · 0.85

Calls 7

get_subjects_dirFunction · 0.85
setFunction · 0.85
read_surfaceFunction · 0.85
mesh_distFunction · 0.85
parallel_funcFunction · 0.85
_n_colorsFunction · 0.85

Tested by 1

test_grow_labelsFunction · 0.72