mne.write_labels_to_annot#
- mne.write_labels_to_annot(labels, subject=None, parc=None, overwrite=False, subjects_dir=None, annot_fname=None, colormap='hsv', hemi='both', sort=True, table_name='MNE-Python Colortable', verbose=None)[source]#
Create a FreeSurfer annotation from a list of labels.
- Parameters:
- labels
list
with instances ofmne.Label
The labels to create a parcellation from.
- subject
str
The FreeSurfer subject name.
- parc
str
|None
The parcellation name to use.
- overwritebool
Overwrite files if they already exist.
- subjects_dirpath-like |
None
The path to the directory containing the FreeSurfer subjects reconstructions. If
None
, defaults to theSUBJECTS_DIR
environment variable.- annot_fname
str
|None
Filename of the
.annot file
. If not None, only this file is written and the argumentsparc
andsubject
are ignored.- colormap
str
Colormap to use to generate label colors for labels that do not have a color specified.
- hemi
'both'
|'lh'
|'rh'
The hemisphere(s) for which to write *.annot files (only applies if annot_fname is not specified; default is ‘both’).
- sortbool
If True (default), labels will be sorted by name before writing.
New in v0.21.0.
- table_name
str
The table name to use for the colortable.
New in v0.21.0.
- verbosebool |
str
|int
|None
Control verbosity of the logging output. If
None
, use the default verbosity level. See the logging documentation andmne.verbose()
for details. Should only be passed as a keyword argument.
- labels
See also
Notes
Vertices that are not covered by any of the labels are assigned to a label named
"unknown"
.