[med-svn] [python-mne] 98/376: ENH : making reading source activations in one label file work
Yaroslav Halchenko
debian at onerussian.com
Fri Nov 27 17:22:16 UTC 2015
This is an automated email from the git hooks/post-receive script.
yoh pushed a commit to annotated tag v0.1
in repository python-mne.
commit 528634d0baf0fb12d14d86f19d7401b7cc577245
Author: Alexandre Gramfort <alexandre.gramfort at inria.fr>
Date: Mon Feb 28 17:54:59 2011 -0500
ENH : making reading source activations in one label file work
---
examples/plot_roi_label_activations.py | 6 +++---
mne/label.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/examples/plot_roi_label_activations.py b/examples/plot_roi_label_activations.py
index b8ca654..ac517e5 100644
--- a/examples/plot_roi_label_activations.py
+++ b/examples/plot_roi_label_activations.py
@@ -11,14 +11,13 @@ Extracting the time series of activations in a label
print __doc__
-import os
-import numpy as np
import mne
from mne.datasets import sample
data_path = sample.data_path('.')
stc_fname = data_path + '/MEG/sample/sample_audvis-meg-lh.stc'
-label_fname = data_path + '/subjects/sample/label/lh.BA1.label'
+label = 'Aud-lh'
+label_fname = data_path + '/MEG/sample/labels/%s.label' % label
values, times, vertices = mne.label_time_courses(label_fname, stc_fname)
@@ -29,4 +28,5 @@ import pylab as pl
pl.plot(times, values.T)
pl.xlabel('time (ms)')
pl.ylabel('Source amplitude')
+pl.title('Activations in Label : %s' % label)
pl.show()
diff --git a/mne/label.py b/mne/label.py
index d46ad48..8634606 100644
--- a/mne/label.py
+++ b/mne/label.py
@@ -70,6 +70,6 @@ def label_time_courses(labelfile, stcfile):
raise ValueError, 'No vertices match the label in the stc file'
values = stc['data'][idx]
- times = stc.tmin + stc.tstep * np.arange(stc.data.shape[1])
+ times = stc['tmin'] + stc['tstep'] * np.arange(stc['data'].shape[1])
return values, times, vertices
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-mne.git
More information about the debian-med-commit
mailing list