[med-svn] [python-mne] 357/376: ENH : fix for new sample dataset

Yaroslav Halchenko debian at onerussian.com
Fri Nov 27 17:23:21 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 3569d70e3baaccbf49cfdcaa1c7aa0ab3ba49862
Author: Alexandre Gramfort <alexandre.gramfort at inria.fr>
Date:   Fri Sep 16 16:21:56 2011 -0400

    ENH : fix for new sample dataset
---
 examples/inverse/plot_morph_data.py   |  6 ++--
 examples/plot_whitened_evoked_data.py | 61 -----------------------------------
 mne/minimum_norm/__init__.py          |  3 +-
 mne/tests/test_source_estimate.py     |  3 +-
 mne/tests/test_source_space.py        |  2 +-
 5 files changed, 7 insertions(+), 68 deletions(-)

diff --git a/examples/inverse/plot_morph_data.py b/examples/inverse/plot_morph_data.py
index 63f9f67..749018f 100644
--- a/examples/inverse/plot_morph_data.py
+++ b/examples/inverse/plot_morph_data.py
@@ -4,8 +4,8 @@ Morph source estimates from one subject to another subject
 ==========================================================
 
 A source estimate from a given subject 'sample' is morphed
-to the anatomy of another subject 'morph'. The output
-is a source estimate defined on the anatomy of 'morph'
+to the anatomy of another subject 'fsaverage'. The output
+is a source estimate defined on the anatomy of 'fsaverage'
 
 """
 # Author: Alexandre Gramfort <gramfort at nmr.mgh.harvard.edu>
@@ -20,7 +20,7 @@ from mne.datasets import sample
 data_path = sample.data_path('..')
 
 subject_from = 'sample'
-subject_to = 'morph'
+subject_to = 'fsaverage'
 
 fname = data_path + '/MEG/sample/sample_audvis-meg'
 src_fname = data_path + '/MEG/sample/sample_audvis-meg-oct-6-fwd.fif'
diff --git a/examples/plot_whitened_evoked_data.py b/examples/plot_whitened_evoked_data.py
deleted file mode 100644
index dff4394..0000000
--- a/examples/plot_whitened_evoked_data.py
+++ /dev/null
@@ -1,61 +0,0 @@
-"""
-==================================================
-Whiten evoked data using a noise covariance matrix
-==================================================
-
-"""
-# Author: Alexandre Gramfort <gramfort at nmr.mgh.harvard.edu>
-#
-# License: BSD (3-clause)
-
-print __doc__
-
-import numpy as np
-import mne
-from mne import fiff
-from mne.datasets import sample
-
-data_path = sample.data_path('.')
-raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
-# raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
-cov_fname = data_path + '/MEG/sample/sample_audvis-cov.fif'
-
-###############################################################################
-# Set epochs parameters
-event_id = 1
-tmin = -0.2
-tmax = 0.5
-
-###############################################################################
-# Create evoked data
-
-# Setup for reading the raw data
-raw = fiff.Raw(raw_fname)
-events = mne.find_events(raw)
-
-# pick EEG channels - bad channels (modify to your needs)
-exclude = raw.info['bads'] + ['EEG 053']  # bads + 1 more
-picks = fiff.pick_types(raw.info, meg=False, eeg=True, stim=False, eog=True,
-                        exclude=exclude)
-epochs = mne.Epochs(raw, events, event_id, tmin, tmax, picks=picks,
-                    baseline=(None, 0), reject=dict(eeg=80e-6, eog=150e-6))
-evoked = epochs.average()  # average epochs and get an Evoked dataset.
-
-cov = mne.Covariance(cov_fname)
-
-# Whiten data
-whitener = cov.get_whitener(evoked.info, pca=False)  # get whitening matrix
-sel = mne.fiff.pick_channels(evoked.ch_names, include=whitener.ch_names)
-whitened_data = np.dot(whitener.W, evoked.data[sel])  # apply whitening
-
-###############################################################################
-# Show result
-times = 1e3 * epochs.times  # in ms
-import pylab as pl
-pl.clf()
-pl.plot(times, whitened_data.T)
-pl.xlim([times[0], times[-1]])
-pl.xlabel('time (ms)')
-pl.ylabel('data (NA)')
-pl.title('Whitened EEG data')
-pl.show()
diff --git a/mne/minimum_norm/__init__.py b/mne/minimum_norm/__init__.py
index fe3d453..6a22998 100644
--- a/mne/minimum_norm/__init__.py
+++ b/mne/minimum_norm/__init__.py
@@ -1,3 +1,4 @@
 from .inverse import read_inverse_operator, apply_inverse, \
-                     apply_inverse_raw, make_inverse_operator
+                     apply_inverse_raw, make_inverse_operator, \
+                     apply_inverse_epochs
 from .time_frequency import source_induced_power
diff --git a/mne/tests/test_source_estimate.py b/mne/tests/test_source_estimate.py
index 46e7623..e24eed0 100644
--- a/mne/tests/test_source_estimate.py
+++ b/mne/tests/test_source_estimate.py
@@ -35,7 +35,7 @@ def test_morph_data():
     """Test morphing of data
     """
     subject_from = 'sample'
-    subject_to = 'morph'
+    subject_to = 'fsaverage'
     fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis-meg')
     stc_from = SourceEstimate(fname)
     stc_to = morph_data(subject_from, subject_to, stc_from,
@@ -67,4 +67,3 @@ def test_spatio_temporal_src_connectivity():
     src[1]['use_tris'] = np.array([[0, 1, 2]])
     connectivity2 = spatio_temporal_src_connectivity(src, 2)
     assert_array_equal(connectivity.todense(), connectivity2.todense())
-
diff --git a/mne/tests/test_source_space.py b/mne/tests/test_source_space.py
index 1213352..7f51e88 100644
--- a/mne/tests/test_source_space.py
+++ b/mne/tests/test_source_space.py
@@ -29,4 +29,4 @@ def test_read_source_spaces():
     assert_true(rh_faces.min() == 0)
     assert_true(rh_faces.max() == rh_points.shape[0] - 1)
     assert_true(rh_use_faces.min() >= 0)
-    assert_true(rh_use_faces.max() <= lh_points.shape[0] - 1)
+    assert_true(rh_use_faces.max() <= rh_points.shape[0] - 1)

-- 
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