mne.
Label
(vertices, pos=None, values=None, hemi=None, comment='', name=None, filename=None, subject=None, color=None, verbose=None)[source]¶A FreeSurfer/MNE label with vertices restricted to one hemisphere.
Labels can be combined with the +
operator:
- Duplicate vertices are removed.
- If duplicate vertices have conflicting position values, an error is raised.
- Values of duplicate vertices are summed.
Parameters: |
|
---|---|
Attributes: |
|
Methods
__add__ (other) |
Add BiHemiLabels. |
__hash__ ($self, /) |
Return hash(self). |
__len__ () |
Return the number of vertices. |
__sub__ (other) |
Subtract BiHemiLabels. |
center_of_mass ([subject, restrict_vertices, …]) |
Compute the center of mass of the label. |
copy () |
Copy the label instance. |
fill (src[, name]) |
Fill the surface between sources for a source space label. |
get_tris (tris[, vertices]) |
Get the source space’s triangles inside the label. |
get_vertices_used ([vertices]) |
Get the source space’s vertices inside the label. |
morph ([subject_from, subject_to, smooth, …]) |
Morph the label. |
save (filename) |
Write to disk as FreeSurfer *.label file. |
smooth ([subject, smooth, grade, …]) |
Smooth the label. |
split ([parts, subject, subjects_dir, freesurfer]) |
Split the Label into two or more parts. |
__hash__
($self, /)¶Return hash(self).
center_of_mass
(subject=None, restrict_vertices=False, subjects_dir=None, surf='sphere')[source]¶Compute the center of mass of the label.
This function computes the spatial center of mass on the surface as in [1].
Parameters: |
|
---|---|
Returns: |
|
See also
Notes
References
[1] | (1, 2) Larson and Lee, “The cortical dynamics underlying effective switching of auditory spatial attention”, NeuroImage 2012. |
fill
(src, name=None)[source]¶Fill the surface between sources for a source space label.
Parameters: |
|
---|---|
Returns: |
|
get_tris
(tris, vertices=None)[source]¶Get the source space’s triangles inside the label.
Parameters: |
|
---|---|
Returns: |
|
get_vertices_used
(vertices=None)[source]¶Get the source space’s vertices inside the label.
Parameters: |
|
---|---|
Returns: |
|
morph
(subject_from=None, subject_to=None, smooth=5, grade=None, subjects_dir=None, n_jobs=1, verbose=None)[source]¶Morph the label.
Useful for transforming a label from one subject to another.
Parameters: |
|
---|---|
Returns: |
|
Notes
This function will set label.pos to be all zeros. If the positions on the new surface are required, consider using mne.read_surface with label.vertices.
save
(filename)[source]¶Write to disk as FreeSurfer *.label file.
Parameters: |
|
---|
Notes
Note that due to file specification limitations, the Label’s subject and color attributes are not saved to disk.
smooth
(subject=None, smooth=2, grade=None, subjects_dir=None, n_jobs=1, verbose=None)[source]¶Smooth the label.
Useful for filling in labels made in a decimated source space for display.
Parameters: |
|
---|---|
Returns: |
|
Notes
This function will set label.pos to be all zeros. If the positions on the new surface are required, consider using mne.read_surface with label.vertices.
split
(parts=2, subject=None, subjects_dir=None, freesurfer=False)[source]¶Split the Label into two or more parts.
Parameters: |
|
---|---|
Returns: |
|
Notes
If using ‘contiguous’ split, you must ensure that the label being split
uses the same triangular resolution as the surface mesh files in
subjects_dir
Also, some small fringe labels may be returned that
are close (but not connected) to the large components.
The spatial split finds the label’s principal eigen-axis on the spherical surface, projects all label vertex coordinates onto this axis, and divides them at regular spatial intervals.