mne.volume_label_adjacency#

mne.volume_label_adjacency(src, subject, subjects_dir, *, aseg='auto', labels=None)[source]#

Compute adjacency between volume labels.

Two labels are considered adjacent if one of their voxels are adjacent in the (volumetric) source space.

Parameters:
srcmne.SourceSpaces

The volumetric source space on which the labels are defined.

subjectstr

The FreeSurfer subject name.

subjects_dirpath-like | None

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

asegstr

The anatomical segmentation file. Default auto uses aparc+aseg if available and wmparc if not. This may be any anatomical segmentation file in the mri subdirectory of the FreeSurfer subject directory.

Changed in version 1.8: Added support for the new default 'auto'.

labelslist of str | None

Labeled regions of interest to plot. See mne.get_montage_volume_labels() for one way to determine regions of interest. Regions can also be chosen from the FreeSurfer LUT. If None, all labels that are defined in the segmentation file are used.

Returns:
label_adjacencyscipy.sparse.coo_matrix

A sparse adjacency matrix containing a 1 for labels that are adjacent and 0 otherwise.

labelslist of str

The names of the labels which contain at least one source point.

See also

label_adjacency

Notes

New in v1.13.