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 4b05bd994d90b9fad764d3a6f3acfae6bbf5d39a Author: Alexandre Gramfort <[email protected]> Date: Mon Mar 14 16:05:09 2011 -0400 cosmit --- mne/epochs.py | 3 +++ mne/stats/cluster_level.py | 9 +++++++-- mne/time_frequency/tfr.py | 10 +++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/mne/epochs.py b/mne/epochs.py index 3d4bd80..6420f38 100644 --- a/mne/epochs.py +++ b/mne/epochs.py @@ -77,6 +77,9 @@ class Epochs(object): self.baseline = baseline self.preload = preload + if len(picks) == 0: + raise ValueError, "Picks cannot be empty." + # Handle measurement info self.info = copy.copy(raw.info) if picks is not None: diff --git a/mne/stats/cluster_level.py b/mne/stats/cluster_level.py index 3a8c19e..fb87998 100644 --- a/mne/stats/cluster_level.py +++ b/mne/stats/cluster_level.py @@ -69,16 +69,21 @@ def permutation_cluster_test(X, stat_fun=f_oneway, threshold=1.67, For a list of 2d-arrays of data, e.g. power values, calculate some statistics for each timepoint (dim 1) over groups. Do a cluster - analysis with permutation test for calculating corrected p-values + analysis with permutation test for calculating corrected p-values. + Randomized data are generated with random partitions of the data. Parameters ---------- - X: list + X : list List of 2d-arrays containing the data, dim 1: timepoints, dim 2: elements of groups stat_fun : callable function called to calculate statistics, must accept 1d-arrays as arguments (default: scipy.stats.f_oneway) + threshold : float + The threshold for the statistic. + n_permutations : int + The number of permutations to compute. tail : -1 or 0 or 1 (default = 0) If tail is 1, the statistic is thresholded above threshold. If tail is -1, the statistic is thresholded below threshold. diff --git a/mne/time_frequency/tfr.py b/mne/time_frequency/tfr.py index 5b933e3..7f2593b 100644 --- a/mne/time_frequency/tfr.py +++ b/mne/time_frequency/tfr.py @@ -216,7 +216,7 @@ def single_trial_power(epochs, Fs, frequencies, use_fft=True, n_cycles=7): return power -def induced_power(data, Fs, frequencies, use_fft=True, n_cycles=7, +def induced_power(epochs, Fs, frequencies, use_fft=True, n_cycles=7, n_jobs=1): """Compute time induced power and inter-trial phase-locking factor @@ -224,7 +224,7 @@ def induced_power(data, Fs, frequencies, use_fft=True, n_cycles=7, Parameters ---------- - data : array + epochs : array 3D array of shape [n_epochs, n_channels, n_times] Fs : float @@ -253,7 +253,7 @@ def induced_power(data, Fs, frequencies, use_fft=True, n_cycles=7, Phase locking factor in [0, 1] (Channels x Frequencies x Timepoints) """ n_frequencies = len(frequencies) - n_epochs, n_channels, n_times = data.shape + n_epochs, n_channels, n_times = epochs.shape # Precompute wavelets for given frequency range to save time Ws = morlet(Fs, frequencies, n_cycles=n_cycles) @@ -269,14 +269,14 @@ def induced_power(data, Fs, frequencies, use_fft=True, n_cycles=7, plf = np.empty((n_channels, n_frequencies, n_times), dtype=np.complex) for c in range(n_channels): - X = np.squeeze(data[:,c,:]) + X = np.squeeze(epochs[:,c,:]) psd[c], plf[c] = _time_frequency(X, Ws, use_fft) else: from joblib import Parallel, delayed psd_plf = Parallel(n_jobs=n_jobs)( delayed(_time_frequency)( - np.squeeze(data[:,c,:]), Ws, use_fft) + np.squeeze(epochs[:,c,:]), Ws, use_fft) for c in range(n_channels)) psd = np.zeros((n_channels, n_frequencies, n_times)) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-mne.git _______________________________________________ debian-med-commit mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit
