mne.read_labels_from_annot#

mne.read_labels_from_annot(subject, parc='aparc', hemi='both', surf_name='white', annot_fname=None, regexp=None, subjects_dir=None, sort=True, verbose=None)[source]#

Read labels from a FreeSurfer annotation file.

Note: Only cortical labels will be returned.

Parameters:
subjectstr

The FreeSurfer subject name.

parcstr

The parcellation to use, e.g., ‘aparc’ or ‘aparc.a2009s’.

hemistr

The hemisphere from which to read the parcellation, can be ‘lh’, ‘rh’, or ‘both’.

surf_namestr

Surface used to obtain vertex locations, e.g., ‘white’, ‘pial’.

annot_fnamestr or None

Filename of the .annot file. If not None, only this file is read and ‘parc’ and ‘hemi’ are ignored.

regexpstr

Regular expression or substring to select particular labels from the parcellation. E.g. ‘superior’ will return all labels in which this substring is contained.

subjects_dirpath-like | None

The path to the directory containing the FreeSurfer subjects reconstructions. If None, defaults to the SUBJECTS_DIR environment variable.

sortbool

If true, labels will be sorted by name before being returned.

New in version 0.21.0.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns:
labelslist of Label

The labels, sorted by label name (ascending).

Examples using mne.read_labels_from_annot#

Corrupt known signal with point spread

Corrupt known signal with point spread

Compare simulated and estimated source activity

Compare simulated and estimated source activity

Simulate raw data using subject anatomy

Simulate raw data using subject anatomy

Generate simulated source data

Generate simulated source data

Cortical Signal Suppression (CSS) for removal of cortical signals

Cortical Signal Suppression (CSS) for removal of cortical signals

Plot a cortical parcellation

Plot a cortical parcellation

Generate a functional label from source estimates

Generate a functional label from source estimates

Compute MNE inverse solution on evoked data with a mixed source space

Compute MNE inverse solution on evoked data with a mixed source space

Visualize source leakage among labels using a circular graph

Visualize source leakage among labels using a circular graph