This documentation is for development version 0.18.dev0.

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', verbose=None)[source]

Create a FreeSurfer annotation from a list of labels.

Parameters:
labels : list with instances of mne.Label

The labels to create a parcellation from.

subject : str | None

The subject for which to write the parcellation.

parc : str | None

The parcellation name to use.

overwrite : bool

Overwrite files if they already exist.

subjects_dir : string, or None

Path to SUBJECTS_DIR if it is not set in the environment.

annot_fname : str | None

Filename of the .annot file. If not None, only this file is written and ‘parc’ and ‘subject’ 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’).

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).

Notes

Vertices that are not covered by any of the labels are assigned to a label named “unknown”.