[med-svn] [python-mne] 40/52: ENH : nicer covariance example

Yaroslav Halchenko debian at onerussian.com
Fri Nov 27 17:23:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

yoh pushed a commit to annotated tag v0.2
in repository python-mne.

commit f60e6ce946126866db49c23cb859c40ef279eb69
Author: Alexandre Gramfort <alexandre.gramfort at inria.fr>
Date:   Sat Oct 29 18:27:18 2011 -0400

    ENH : nicer covariance example
---
 examples/plot_estimate_covariance_matrix.py | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/examples/plot_estimate_covariance_matrix.py b/examples/plot_estimate_covariance_matrix.py
index cc5888e..99bb876 100644
--- a/examples/plot_estimate_covariance_matrix.py
+++ b/examples/plot_estimate_covariance_matrix.py
@@ -23,10 +23,26 @@ raw = fiff.Raw(fname)
 cov = mne.compute_raw_data_covariance(raw, reject=dict(eeg=80e-6, eog=150e-6))
 print cov
 
+bads = raw.info['bads']
+sel_eeg = mne.fiff.pick_types(raw.info, meg=False, eeg=True, exclude=bads)
+sel_mag = mne.fiff.pick_types(raw.info, meg='mag', eeg=False, exclude=bads)
+sel_grad = mne.fiff.pick_types(raw.info, meg='grad', eeg=False, exclude=bads)
+idx_eeg = [cov.ch_names.index(raw.ch_names[c]) for c in sel_eeg]
+idx_mag = [cov.ch_names.index(raw.ch_names[c]) for c in sel_mag]
+idx_grad = [cov.ch_names.index(raw.ch_names[c]) for c in sel_grad]
+
 ###############################################################################
 # Show covariance
 import pylab as pl
-pl.figure()
-pl.imshow(cov.data, interpolation="nearest")
-pl.title('Full covariance matrix')
+pl.figure(figsize=(7.3, 2.7))
+pl.subplot(1, 3, 1)
+pl.imshow(cov.data[idx_eeg][:, idx_eeg], interpolation="nearest")
+pl.title('EEG covariance')
+pl.subplot(1, 3, 2)
+pl.imshow(cov.data[idx_grad][:, idx_grad], interpolation="nearest")
+pl.title('Gradiometers')
+pl.subplot(1, 3, 3)
+pl.imshow(cov.data[idx_mag][:, idx_mag], interpolation="nearest")
+pl.title('Magnetometers')
+pl.subplots_adjust(0.04, 0.0, 0.98, 0.94, 0.2, 0.26)
 pl.show()

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