Reading an STC file#

STC files contain activations on cortex ie. source reconstructions

# Author: Alexandre Gramfort <>
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.
import matplotlib.pyplot as plt

import mne
from mne.datasets import sample


data_path = sample.data_path()
meg_path = data_path / "MEG" / "sample"
fname = meg_path / "sample_audvis-meg"

stc = mne.read_source_estimate(fname)

n_vertices, n_samples =
print(f"stc data size: {n_vertices} (nb of vertices) x {n_samples} (nb of samples)")

# View source activations
plt.plot(stc.times,[::100, :].T)
plt.xlabel("time (ms)")
plt.ylabel("Source amplitude")
read stc
stc data size: 7498 (nb of vertices) x 25 (nb of samples)

Total running time of the script: (0 minutes 2.446 seconds)

Estimated memory usage: 9 MB

Gallery generated by Sphinx-Gallery