[med-svn] [python-mne] 220/376: ENH : adding option to subtract_evoked in source_induced_power
Yaroslav Halchenko
debian at onerussian.com
Fri Nov 27 17:22:43 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 8bd01b8bd6b7a3a623b4b75d4d7c828ecd98047f
Author: Alexandre Gramfort <alexandre.gramfort at inria.fr>
Date: Tue Apr 26 11:56:28 2011 -0400
ENH : adding option to subtract_evoked in source_induced_power
---
mne/minimum_norm/time_frequency.py | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/mne/minimum_norm/time_frequency.py b/mne/minimum_norm/time_frequency.py
index 44710b5..d70c7b3 100644
--- a/mne/minimum_norm/time_frequency.py
+++ b/mne/minimum_norm/time_frequency.py
@@ -38,7 +38,8 @@ def _compute_power(data, K, sel, Ws, source_ori, use_fft):
def source_induced_power(epochs, inverse_operator, bands, lambda2=1.0 / 9.0,
dSPM=True, n_cycles=5, df=1, use_fft=False,
- baseline=None, baseline_mode='logratio', n_jobs=1):
+ baseline=None, baseline_mode='logratio',
+ subtract_evoked=False, n_jobs=1):
"""Compute source space induced power
Parameters
@@ -67,12 +68,15 @@ def source_induced_power(epochs, inverse_operator, bands, lambda2=1.0 / 9.0,
and if b is None then b is set to the end of the interval.
If baseline is equal ot (None, None) all the time
interval is used.
- baseline_mode : None | 'logratio' | 'zscore'
+ baseline_mode: None | 'logratio' | 'zscore'
Do baseline correction with ratio (power is divided by mean
power during baseline) or zscore (power is divided by standard
deviatio of power during baseline after substracting the mean,
power = [power - mean(power_baseline)] / std(power_baseline))
- n_jobs : int
+ subtract_evoked: bool
+ If True, the evoked component (average of all epochs) if subtracted
+ from each epochs.
+ n_jobs: int
Number of jobs to run in parallel
"""
@@ -98,6 +102,10 @@ def source_induced_power(epochs, inverse_operator, bands, lambda2=1.0 / 9.0,
# Set up the inverse according to the parameters
#
epochs_data = epochs.get_data()
+
+ if subtract_evoked: # subtract with a copy not to touch epochs
+ epochs_data = epochs_data - np.mean(epochs_data, axis=0)
+
nave = len(epochs_data) # XXX : can do better when no preload
inv = prepare_inverse_operator(inverse_operator, nave, lambda2, dSPM)
--
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