@verbose
    def morph(self, subject_from=None, subject_to=None, smooth=5, grade=None,
              subjects_dir=None, n_jobs=1, copy=None, verbose=None):
        subject_from = _check_subject(self.subject, subject_from)
        if not isinstance(subject_to, string_types):
            raise TypeError('"subject_to" must be entered as a string')
        if not isinstance(smooth, int):
            raise TypeError('smooth must be an integer')
        if np.all(self.values == 0):
            raise ValueError('Morphing label with all zero values will result '
                             'in the label having no vertices. Consider using '
                             'something like label.values.fill(1.0).')
        if(isinstance(grade, np.ndarray)):
            if self.hemi == 'lh':
                grade = [grade, np.array([], int)]
            else:
                grade = [np.array([], int), grade]
        if self.hemi == 'lh':
            vertices = [self.vertices, np.array([], int)]
        else:
            vertices = [np.array([], int), self.vertices]
        data = self.values[:, np.newaxis]
        stc = SourceEstimate(data, vertices, tmin=1, tstep=1,
                             subject=subject_from)
        stc = morph_data(subject_from, subject_to, stc, grade=grade,
                         smooth=smooth, subjects_dir=subjects_dir,
                         warn=False, n_jobs=n_jobs)
        inds = np.nonzero(stc.data)[0]
        label = _check_copy_dep(self, copy, default=True)
        label.values = stc.data[inds, :].ravel()
        label.pos = np.zeros((len(inds), 3))
        if label.hemi == 'lh':
            label.vertices = stc.vertices[0][inds]
        else:
            label.vertices = stc.vertices[1][inds]
        label.subject = subject_to
        return label
Morph the label
dataset/ETHPy150Open mne-tools/mne-python/mne/label.py/Label.morph