mne.labels_to_stc(labels, values, tmin=0, tstep=1, subject=None, src=None, verbose=None)[source]#

Convert a set of labels and values to a STC.

This function is meant to work like the opposite of extract_label_time_course.

labelsLabel | BiHemiLabel | list | tuple | str

If using a surface or mixed source space, this should be the Label’s for which to extract the time course. If working with whole-brain volume source estimates, this must be one of:

  • a string path to a FreeSurfer atlas for the subject (e.g., their ‘aparc.a2009s+aseg.mgz’) to extract time courses for all volumes in the atlas

  • a two-element list or tuple, the first element being a path to an atlas, and the second being a list or dict of volume_labels to extract (see mne.setup_volume_source_space() for details).

Changed in version 0.21.0: Support for volume source estimates.

valuesndarray, shape (n_labels, …)

The values in each label. Can be 1D or 2D.


The tmin to use for the STC.


The tstep to use for the STC.


The FreeSurfer subject name.

srcinstance of SourceSpaces

The source spaces for the source time courses. Can be omitted if using a surface source space, in which case the label vertices will determine the output STC vertices. Required if using a volumetric source space.

New in v0.22.

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.

stcinstance of SourceEstimate | instance of VolSourceEstimate

The values-in-labels converted to a STC.


Vertices that appear in more than one label will be averaged.

New in v0.18.

Examples using mne.labels_to_stc#

Visualize source time courses (stcs)

Visualize source time courses (stcs)