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

Method smooth

mne/label.py:568–619  ·  view source on GitHub ↗

Smooth the label. Useful for filling in labels made in a decimated source space for display. Parameters ---------- %(subject_label)s smooth : int Number of iterations for the smoothing of the surface data. Cannot be None here

(
        self,
        subject=None,
        smooth=2,
        grade=None,
        subjects_dir=None,
        n_jobs=None,
        verbose=None,
    )

Source from the content-addressed store, hash-verified

566
567 @verbose
568 def smooth(
569 self,
570 subject=None,
571 smooth=2,
572 grade=None,
573 subjects_dir=None,
574 n_jobs=None,
575 verbose=None,
576 ):
577 """Smooth the label.
578
579 Useful for filling in labels made in a
580 decimated source space for display.
581
582 Parameters
583 ----------
584 %(subject_label)s
585 smooth : int
586 Number of iterations for the smoothing of the surface data.
587 Cannot be None here since not all vertices are used. For a
588 grade of 5 (e.g., fsaverage), a smoothing of 2 will fill a
589 label.
590 grade : int, list of shape (2,), array, or None
591 Resolution of the icosahedral mesh (typically 5). If None, all
592 vertices will be used (potentially filling the surface). If a list,
593 values will be morphed to the set of vertices specified in grade[0]
594 and grade[1], assuming that these are vertices for the left and
595 right hemispheres. Note that specifying the vertices (e.g.,
596 grade=[np.arange(10242), np.arange(10242)] for fsaverage on a
597 standard grade 5 source space) can be substantially faster than
598 computing vertex locations. If one array is used, it is assumed
599 that all vertices belong to the hemisphere of the label. To create
600 a label filling the surface, use None.
601 %(subjects_dir)s
602 %(n_jobs)s
603 %(verbose)s
604
605 Returns
606 -------
607 label : instance of Label
608 The smoothed label.
609
610 Notes
611 -----
612 This function will set label.pos to be all zeros. If the positions
613 on the new surface are required, consider using mne.read_surface
614 with ``label.vertices``.
615 """
616 subject = _check_subject(self.subject, subject)
617 return self.morph(
618 subject, subject, smooth, grade, subjects_dir, n_jobs, verbose=verbose
619 )
620
621 @verbose
622 def morph(

Callers 1

test_morphFunction · 0.80

Calls 2

morphMethod · 0.95
_check_subjectFunction · 0.85

Tested by 1

test_morphFunction · 0.64