mne.
Label
(vertices, pos=None, values=None, hemi=None, comment='', name=None, filename=None, subject=None, color=None, verbose=None)¶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: | vertices : array (length N)
pos : array (N by 3) | None
values : array (length N) | None
hemi : ‘lh’ | ‘rh’
comment : str
name : str
filename : str
subject : str | None
color : None | matplotlib color
verbose : bool, str, int, or None
|
---|---|
Attributes: | color : None | tuple
comment : str
hemi : ‘lh’ | ‘rh’
name : None | str
pos : array, shape = (n_pos, 3)
subject : str | None
values : array, len = n_pos
verbose : bool, str, int, or None
vertices : array, len = n_pos
|
Methods
copy () |
Copy the label instance. |
fill (src[, name]) |
Fill the surface between sources for a label defined in source space |
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 |
__init__
(vertices, pos=None, values=None, hemi=None, comment='', name=None, filename=None, subject=None, color=None, verbose=None)¶copy
()¶Copy the label instance.
Returns: | label : instance of Label
|
---|
fill
(src, name=None)¶Fill the surface between sources for a label defined in source space
Parameters: | src : SourceSpaces
name : None | str
|
---|---|
Returns: | label : Label
|
get_tris
(tris, vertices=None)¶Get the source space’s triangles inside the label
Parameters: | tris : ndarray of int, shape (n_tris, 3)
vertices : ndarray of int, shape (n_vertices,) | None
|
---|---|
Returns: | label_tris : ndarray of int, shape (n_tris, 3)
|
get_vertices_used
(vertices=None)¶Get the source space’s vertices inside the label
Parameters: | vertices : ndarray of int, shape (n_vertices,) | None
|
---|---|
Returns: | label_verts : ndarray of in, shape (n_label_vertices,)
|
morph
(subject_from=None, subject_to=None, smooth=5, grade=None, subjects_dir=None, n_jobs=1, copy=True, verbose=None)¶Morph the label
Useful for transforming a label from one subject to another.
Parameters: | subject_from : str | None
subject_to : str
smooth : int
grade : int, list (of two arrays), array, or None
subjects_dir : string, or None
n_jobs : int
copy : bool
verbose : bool, str, int, or None
|
---|---|
Returns: | label : instance of Label
|
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)¶Write to disk as FreeSurfer *.label file
Parameters: | filename : string
|
---|
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, copy=True, verbose=None)¶Smooth the label
Useful for filling in labels made in a decimated source space for display.
Parameters: | subject : str | None
smooth : int
grade : int, list (of two arrays), array, or None
subjects_dir : string, or None
n_jobs : int
copy : bool
verbose : bool, str, int, or None
|
---|---|
Returns: | label : instance of Label
|
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)¶Split the Label into two or more parts
Parameters: | parts : int >= 2 | tuple of str
subject : None | str
subjects_dir : None | str
freesurfer : bool
|
---|---|
Returns: | labels : list of Label (len = n_parts)
|
Notes
Works by finding the label’s principal eigen-axis on the spherical surface, projecting all label vertex coordinates onto this axis and dividing them at regular spatial intervals.