def test_io_stc(): """Test IO for STC files """ stc = read_stc(fname) write_stc(op.join(tempdir, "tmp.stc"), stc['tmin'], stc['tstep'], stc['vertices'], stc['data']) stc2 = read_stc(op.join(tempdir, "tmp.stc")) assert_array_almost_equal(stc['data'], stc2['data']) assert_array_almost_equal(stc['tmin'], stc2['tmin']) assert_array_almost_equal(stc['vertices'], stc2['vertices']) assert_array_almost_equal(stc['tstep'], stc2['tstep'])
def test_io_stc(): """Test IO for STC files """ stc = mne.read_stc(fname) mne.write_stc("tmp.stc", stc['tmin'], stc['tstep'], stc['vertices'], stc['data']) stc2 = mne.read_stc("tmp.stc") assert_array_almost_equal(stc['data'], stc2['data']) assert_array_almost_equal(stc['tmin'], stc2['tmin']) assert_array_almost_equal(stc['vertices'], stc2['vertices']) assert_array_almost_equal(stc['tstep'], stc2['tstep'])
reconstructions """ # Author: Alexandre Gramfort <*****@*****.**> # # License: BSD (3-clause) print __doc__ import os import numpy as np import mne fname = os.environ['MNE_SAMPLE_DATASET_PATH'] fname += '/MEG/sample/sample_audvis-meg-lh.stc' stc = mne.read_stc(fname) n_vertices, n_samples = stc['data'].shape print "tmin : %s (s)" % stc['tmin'] print "tstep : %s" % stc['tstep'] print "tmax : %s (s)" % (stc['tmin'] + stc['tstep'] * n_samples) print "stc data size: %s (nb of vertices) x %s (nb of samples)" % ( n_vertices, n_samples) # View source activations times = stc['tmin'] + stc['tstep'] * np.arange(n_samples) import pylab as pl pl.plot(times, stc['data'][::100,:].T) pl.xlabel('time (ms)') pl.ylabel('Source amplitude') pl.show()