{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n\n# Reading an STC file\n\nSTC files contain activations on cortex ie. source\nreconstructions\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Author: Alexandre Gramfort \n#\n# License: BSD-3-Clause\n# Copyright the MNE-Python contributors." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n\nimport mne\nfrom mne.datasets import sample\n\nprint(__doc__)\n\ndata_path = sample.data_path()\nmeg_path = data_path / \"MEG\" / \"sample\"\nfname = meg_path / \"sample_audvis-meg\"\n\nstc = mne.read_source_estimate(fname)\n\nn_vertices, n_samples = stc.data.shape\nprint(f\"stc data size: {n_vertices} (nb of vertices) x {n_samples} (nb of samples)\")\n\n# View source activations\nplt.plot(stc.times, stc.data[::100, :].T)\nplt.xlabel(\"time (ms)\")\nplt.ylabel(\"Source amplitude\")\nplt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 0 }