

def fill(self, src, name=None):
    'Fill the surface between sources for a label defined in source space\n\n        Parameters\n        ----------\n        src : SourceSpaces\n            Source space in which the label was defined. If a source space is\n            provided, the label is expanded to fill in surface vertices that\n            lie between the vertices included in the source space. For the\n            added vertices, ``pos`` is filled in with positions from the\n            source space, and ``values`` is filled in from the closest source\n            space vertex.\n        name : None | str\n            Name for the new Label (default is self.name).\n\n        Returns\n        -------\n        label : Label\n            The label covering the same vertices in source space but also\n            including intermediate surface vertices.\n        '
    if (self.hemi == 'lh'):
        hemi_src = src[0]
    elif (self.hemi == 'rh'):
        hemi_src = src[1]
    if (not np.all(in1d(self.vertices, hemi_src['vertno']))):
        msg = "Source space does not contain all of the label's vertices"
        raise ValueError(msg)
    nearest = hemi_src['nearest']
    if (nearest is None):
        warn('Computing patch info for source space, this can take a while. In order to avoid this in the future, run mne.add_source_space_distances() on the source space and save it.')
        add_source_space_distances(src)
        nearest = hemi_src['nearest']
    include = in1d(nearest, self.vertices, False)
    vertices = np.nonzero(include)[0]
    nearest_in_label = digitize(nearest[vertices], self.vertices, True)
    values = self.values[nearest_in_label]
    pos = hemi_src['rr'][vertices]
    if (name is None):
        name = name.name
    label = Label(vertices, pos, values, self.hemi, self.comment, name, None, self.subject, self.color)
    return label

dataset/ETHPy150Open mne-tools/mne-python/mne/label.py Label.fill/VarMisuse@195/612 `self`->`name`