[med-svn] [python-mne] 164/376: adding epoch rejection everywhere

Yaroslav Halchenko debian at onerussian.com
Fri Nov 27 17:22:27 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 758c90bddbd31403e1d9e7a0b843d6e5c2902cf4
Author: Alexandre Gramfort <alexandre.gramfort at inria.fr>
Date:   Mon Mar 28 16:08:37 2011 -0400

    adding epoch rejection everywhere
---
 examples/plot_from_raw_to_epochs_to_evoked.py            | 1 +
 examples/plot_whitened_evoked_data.py                    | 1 +
 examples/stats/plot_cluster_1samp_test_time_frequency.py | 1 +
 examples/stats/plot_cluster_stats_evoked.py              | 2 ++
 examples/stats/plot_cluster_stats_time_frequency.py      | 2 ++
 examples/stats/plot_sensor_permutation_test.py           | 1 +
 examples/time_frequency/plot_time_frequency.py           | 1 +
 mne/tests/test_epochs.py                                 | 1 +
 8 files changed, 10 insertions(+)

diff --git a/examples/plot_from_raw_to_epochs_to_evoked.py b/examples/plot_from_raw_to_epochs_to_evoked.py
index 6582ed7..629f70b 100644
--- a/examples/plot_from_raw_to_epochs_to_evoked.py
+++ b/examples/plot_from_raw_to_epochs_to_evoked.py
@@ -41,6 +41,7 @@ picks = fiff.pick_types(raw.info, meg=False, eeg=True, stim=False,
 # Read epochs
 epochs = mne.Epochs(raw, events, event_id,
                             tmin, tmax, picks=picks, baseline=(None, 0))
+epochs.reject(grad=4000e-13, mag=4e-12, eeg=40e-6, eog=150e-6)
 evoked = epochs.average() # average epochs and get an Evoked dataset.
 
 evoked.save('sample_audvis_eeg-ave.fif') # save evoked data to disk
diff --git a/examples/plot_whitened_evoked_data.py b/examples/plot_whitened_evoked_data.py
index ab7a47e..01985ac 100644
--- a/examples/plot_whitened_evoked_data.py
+++ b/examples/plot_whitened_evoked_data.py
@@ -39,6 +39,7 @@ picks = fiff.pick_types(raw.info, meg=False, eeg=True, stim=False,
                         exclude=exclude)
 epochs = mne.Epochs(raw, events, event_id,
                     tmin, tmax, picks=picks, baseline=(None, 0))
+epochs.reject(grad=4000e-13, mag=4e-12, eeg=40e-6, eog=150e-6)
 evoked = epochs.average() # average epochs and get an Evoked dataset.
 
 cov = mne.Covariance()
diff --git a/examples/stats/plot_cluster_1samp_test_time_frequency.py b/examples/stats/plot_cluster_1samp_test_time_frequency.py
index 6e8b57a..a7fad3a 100644
--- a/examples/stats/plot_cluster_1samp_test_time_frequency.py
+++ b/examples/stats/plot_cluster_1samp_test_time_frequency.py
@@ -56,6 +56,7 @@ ch_name = raw.info['ch_names'][picks[0]]
 event_id = 1
 epochs = mne.Epochs(raw, events, event_id,
                     tmin, tmax, picks=picks, baseline=(None, 0))
+epochs.reject(grad=4000e-13, mag=4e-12, eeg=40e-6, eog=150e-6)
 data = epochs.get_data() # as 3D matrix
 data *= 1e13 # change unit to fT / cm
 # Time vector
diff --git a/examples/stats/plot_cluster_stats_evoked.py b/examples/stats/plot_cluster_stats_evoked.py
index e4c5cd4..08fbe55 100644
--- a/examples/stats/plot_cluster_stats_evoked.py
+++ b/examples/stats/plot_cluster_stats_evoked.py
@@ -42,11 +42,13 @@ picks = fiff.pick_types(raw.info, meg=False, include=include)
 event_id = 1
 epochs1 = mne.Epochs(raw, events, event_id,
                             tmin, tmax, picks=picks, baseline=(None, 0))
+epochs1.reject(grad=4000e-13, mag=4e-12, eeg=40e-6, eog=150e-6)
 condition1 = epochs1.get_data() # as 3D matrix
 
 event_id = 2
 epochs2 = mne.Epochs(raw, events, event_id,
                             tmin, tmax, picks=picks, baseline=(None, 0))
+epochs2.reject(grad=4000e-13, mag=4e-12, eeg=40e-6, eog=150e-6)
 condition2 = epochs2.get_data() # as 3D matrix
 
 condition1 = condition1[:,0,:] # take only one channel to get a 2D array
diff --git a/examples/stats/plot_cluster_stats_time_frequency.py b/examples/stats/plot_cluster_stats_time_frequency.py
index 095bef4..55c0b06 100644
--- a/examples/stats/plot_cluster_stats_time_frequency.py
+++ b/examples/stats/plot_cluster_stats_time_frequency.py
@@ -57,6 +57,7 @@ ch_name = raw.info['ch_names'][picks[0]]
 event_id = 1
 epochs_condition_1 = mne.Epochs(raw, events, event_id,
                     tmin, tmax, picks=picks, baseline=(None, 0))
+epochs_condition_1.reject(grad=4000e-13, mag=4e-12, eeg=40e-6, eog=150e-6)
 data_condition_1 = epochs_condition_1.get_data() # as 3D matrix
 data_condition_1 *= 1e13 # change unit to fT / cm
 
@@ -64,6 +65,7 @@ data_condition_1 *= 1e13 # change unit to fT / cm
 event_id = 2
 epochs_condition_2 = mne.Epochs(raw, events, event_id,
                     tmin, tmax, picks=picks, baseline=(None, 0))
+epochs_condition_2.reject(grad=4000e-13, mag=4e-12, eeg=40e-6, eog=150e-6)
 data_condition_2 = epochs_condition_2.get_data() # as 3D matrix
 data_condition_2 *= 1e13 # change unit to fT / cm
 
diff --git a/examples/stats/plot_sensor_permutation_test.py b/examples/stats/plot_sensor_permutation_test.py
index 41969ec..17d3d1a 100644
--- a/examples/stats/plot_sensor_permutation_test.py
+++ b/examples/stats/plot_sensor_permutation_test.py
@@ -44,6 +44,7 @@ picks = fiff.pick_types(raw.info, meg='grad', eeg=False, stim=False,
                                             include=include, exclude=exclude)
 epochs = mne.Epochs(raw, events, event_id,
                             tmin, tmax, picks=picks, baseline=(None, 0))
+epochs.reject(grad=4000e-13, mag=4e-12, eog=150e-6)
 data = epochs.get_data()
 times = epochs.times
 
diff --git a/examples/time_frequency/plot_time_frequency.py b/examples/time_frequency/plot_time_frequency.py
index 2ee160f..7933d40 100644
--- a/examples/time_frequency/plot_time_frequency.py
+++ b/examples/time_frequency/plot_time_frequency.py
@@ -44,6 +44,7 @@ picks = fiff.pick_types(raw.info, meg='grad', eeg=False,
 picks = [picks[97]]
 epochs = mne.Epochs(raw, events, event_id,
                     tmin, tmax, picks=picks, baseline=(None, 0))
+epochs.reject(grad=4000e-13, mag=4e-12, eeg=40e-6, eog=150e-6)
 data = epochs.get_data() # as 3D matrix
 evoked = epochs.average() # compute evoked fields
 
diff --git a/mne/tests/test_epochs.py b/mne/tests/test_epochs.py
index 3760b3f..85ebc01 100644
--- a/mne/tests/test_epochs.py
+++ b/mne/tests/test_epochs.py
@@ -32,4 +32,5 @@ def test_read_epochs():
 
     epochs = mne.Epochs(raw, events, event_id, tmin, tmax, picks=picks,
                         baseline=(None, 0))
+    epochs.reject(grad=4000e-13, mag=4e-12, eeg=40e-6, eog=150e-6)
     epochs.average()

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