Return the significant clusters at a given threshold.
Parameters:
thresh (float) – The threshold to consider a cluster significant eg 95 or 99
Returns:
clusters – A list containing the significant clusters. Each list item contains
a tuple of three items - the cluster statistic, the cluster
percentile relative to the null and the spatial/spectral indices of
the cluster.
Return the significant clusters at a given threshold.
Parameters:
thresh (float) – The threshold to consider a cluster significant eg 95 or 99
Returns:
clusters – A list containing the significant clusters. Each list item contains
a tuple of three items - the cluster statistic, the cluster
percentile relative to the null and the spatial/spectral indices of
the cluster.
Compute a group GLM-Spectrum from an array of first-level spectra
Parameters:
fl_data (array_like) – An array containing first level power spectra with the first two dimensions being
number of participants and then any first-level contrasts.
design_config (glmtools.design.DesignConfig) – The design specification for the group level model (Default value = None)
datainfo (dict) – Dictionary of data values to use as covariates. The length of each
covariate must match the number of input GLM-Spectra (Default value =
None)
spectrum_config (sails.stft.GLMPeriodogramConfig) – Configuration of spectrum estimate
info (mne.io.meas_info.Info) – Specification of electrophysiology data
Compute a group GLM-Spectrum from a set of first-level GLM-Spectra.
Parameters:
inspectra (list, tuple) – A list containing either the filepaths of a set of saved GLM-Spectra
objects, or the GLM-Spectra objects themselves.
design_config (glmtools.design.DesignConfig) – The design specification for the group level model (Default value = None)
datainfo (dict) – Dictionary of data values to use as covariates. The length of each
covariate must match the number of input GLM-Spectra (Default value =
None)
metric ({'copes', or 'tsats'}) – Which metric to plot (Default value = ‘copes’)
Returns:
GroupSensorGLMSpectrum instance containing the group level GLM-Spectrum.
Compute a GLM-Spectrum from a MNE-Python Raw data object.
Parameters:
XX ({MNE Raw object, or data array}) – Data to compute GLM-Spectrum from
standardise_data (bool) – Flag indicating whether to z-transform input data (Default value = False)
reg_categorical (dict or None) – Dictionary of covariate time series to be added as binary regessors. (Default value = None)
reg_ztrans (dict or None) – Dictionary of covariate time series to be added as z-standardised regessors. (Default value = None)
reg_unitmax (dict or None) – Dictionary of confound time series to be added as positive-valued unitmax regessors. (Default value = None)
contrasts (dict or None) – Dictionary of contrasts to be computed in the model.
(Default value = None, will add a simple contrast for each regressor)
fit_intercept (bool) – Specifies whether a constant valued ‘intercept’ regressor is included in the model. (Default value = True)’
nperseg (int) – Length of each segment. Defaults to None, but if window is str or
tuple, is set to 256, and if window is array_like, is set to the
length of the window.
noverlap (int) – Number of samples that successive sliding windows should overlap.
window_type (str or tuple or array_like, optional) – Desired window to use. If window is a string or tuple, it is
passed to scipy.signal.windows.get_window to generate the
window values, which are DFT-even by default. See scipy.signal.windows
for a list of windows and required parameters.
If window is array_like it will be used directly as the window and its
length must be nperseg. Defaults to a Hann window.
detrend (str or function or False, optional) – Specifies how to detrend each segment. If detrend is a
string, it is passed as the type argument to the detrend
function. If it is a function, it takes a segment and returns a
detrended segment. If detrend is False, no detrending is
done. Defaults to ‘constant’.’
nfft (int) – Length of the FFT to use (Default value = 256)
axis (int) – Axis of input array along which the computation is performed. (Default value = -1)
return_onesided (bool, optional) – If True, return a one-sided spectrum for real data. If
False return a two-sided spectrum. Defaults to True, but for
complex data, a two-sided spectrum is always returned.
mode ({'psd', 'magnitude', 'angle', 'phase', 'complex'}) – Which type of spectrum to return (Default value = ‘psd’)
scaling ({ 'density', 'spectrum' }) – Selects between computing the power spectral density (‘density’)
where Pxx has units of V**2/Hz and computing the power
spectrum (‘spectrum’) where Pxx has units of V**2, if x
is measured in V and fs is measured in Hz. Defaults to
‘density’
fs (float) – Sampling rate of the data
fmin ({float, None}) – Smallest frequency in desired range (left hand boundary)
fmax ({float, None}) – Largest frequency in desired range (right hand boundary)’
verbose ({None, 'DEBUG', 'INFO', 'WARNING', 'CRITICAL'}) – String indicating the level of detail to be printed to the screen during computation.’
Returns:
SensorGLMSpectrum instance containing the fitted GLM-Spectrum.
Compute a GLM-IRASA from a MNE-Python Raw data object.
Parameters:
XX ({MNE Raw object, or data array}) – Data to compute GLM-Spectrum from
standardise_data (bool) – Flag indicating whether to z-transform input data (Default value = False)
reg_categorical (dict or None) – Dictionary of covariate time series to be added as binary regessors. (Default value = None)
reg_ztrans (dict or None) – Dictionary of covariate time series to be added as z-standardised regessors. (Default value = None)
reg_unitmax (dict or None) – Dictionary of confound time series to be added as positive-valued unitmax regessors. (Default value = None)
contrasts (dict or None) – Dictionary of contrasts to be computed in the model.
(Default value = None, will add a simple contrast for each regressor)
fit_intercept (bool) – Specifies whether a constant valued ‘intercept’ regressor is included in the model. (Default value = True)’
method ({'original', 'modified'}) – whether to compute the original implementation of IRASA or the modified update
(default is ‘modified’)
resample_factors ({None, array_like}) – array of resampling factors to average across or None, in which a set
of factors are automatically computed (default is None).
aperiodic_average ({'mean', 'median', 'median_bias', 'min'}) – method for averaging across irregularly resampled spectra to estimate
the aperiodic component (default is ‘median’).’
nperseg (int) – Length of each segment. Defaults to None, but if window is str or
tuple, is set to 256, and if window is array_like, is set to the
length of the window.
noverlap (int) – Number of samples that successive sliding windows should overlap.
window_type (str or tuple or array_like, optional) – Desired window to use. If window is a string or tuple, it is
passed to scipy.signal.windows.get_window to generate the
window values, which are DFT-even by default. See scipy.signal.windows
for a list of windows and required parameters.
If window is array_like it will be used directly as the window and its
length must be nperseg. Defaults to a Hann window.
detrend (str or function or False, optional) – Specifies how to detrend each segment. If detrend is a
string, it is passed as the type argument to the detrend
function. If it is a function, it takes a segment and returns a
detrended segment. If detrend is False, no detrending is
done. Defaults to ‘constant’.’
nfft (int) – Length of the FFT to use (Default value = 256)
axis (int) – Axis of input array along which the computation is performed. (Default value = -1)
return_onesided (bool, optional) – If True, return a one-sided spectrum for real data. If
False return a two-sided spectrum. Defaults to True, but for
complex data, a two-sided spectrum is always returned.
mode ({'psd', 'magnitude', 'angle', 'phase', 'complex'}) – Which type of spectrum to return (Default value = ‘psd’)
scaling ({ 'density', 'spectrum' }) – Selects between computing the power spectral density (‘density’)
where Pxx has units of V**2/Hz and computing the power
spectrum (‘spectrum’) where Pxx has units of V**2, if x
is measured in V and fs is measured in Hz. Defaults to
‘density’
fs (float) – Sampling rate of the data
fmin ({float, None}) – Smallest frequency in desired range (left hand boundary)
fmax ({float, None}) – Largest frequency in desired range (right hand boundary)’
verbose ({None, 'DEBUG', 'INFO', 'WARNING', 'CRITICAL'}) – String indicating the level of detail to be printed to the screen during computation.’
Returns:
SensorGLMSpectrum instance containing the fitted GLM-Spectrum.
Plot a GLM-Spectrum contrast from cluster objects, with spatial line colouring and topograpies.
Parameters:
xvect (array_like) – Frequency vector
psd (array_like) – Spectrum values
clusters (list) – List of cluster objects
info (dict) – MNE-Python info object
ax ({None or axis handle}) – Axis to plot into (Default value = None)
freqs ({list, tuple or 'auto'}) – Which frequencies to plot topos for (Default value = ‘auto’)
base (float) – The x-axis scaling, set to 0.5 for sqrt freq axis (Default value = 1)
topo_scale ({'joint' or None}) – Whether to fix topomap colour scales across all topos (‘joint’) or
leave them individual (Default value = ‘joint’)
lw (float) – Line width(Default value = 0.5)
ylabel (str) – Y-axis label(Default value = ‘Power’)
title (str) – Plot title(Default value = None)
ylim ({tuple or list}) – min and max values for y-axis (Default value = None)
xtick_skip (int) – Number of xaxis ticks to skip, useful for tight plots (Default value = 1)
topo_prop (float) – Proportion of plot dedicted to topomaps(Default value = 1/3)
topo_cmap ({None or matplotlib colormap}) – Colormap to use for plotting (Default is ‘RdBu_r’ if pooled topo data range
is positive and negative, otherwise ‘Reds’ or ‘Blues’ depending on sign of
pooled data range)
ax ({None or axis handle}) – Axis to plot into (Default value = None)
freqs ({list, tuple or 'auto'}) – Which frequencies to plot topos for (Default value = ‘auto’)
base (float) – The x-axis scaling, set to 0.5 for sqrt freq axis (Default value = 1)
topo_scale ({'joint' or None}) – Whether to fix topomap colour scales across all topos (‘joint’) or
leave them individual (Default value = ‘joint’)
lw (flot) – Line width(Default value = 0.5)
ylabel (str) – Y-axis label(Default value = ‘Power’)
title (str) – Plot title(Default value = None)
ylim ({tuple or list}) – min and max values for y-axis (Default value = None)
xtick_skip (int) – Number of xaxis ticks to skip, useful for tight plots (Default value = 1)
topo_prop (float) – Proportion of plot dedicted to topomaps(Default value = 1/3)
topo_cmap ({None or matplotlib colormap}) – Colormap to use for plotting (Default value is ‘RdBu_r’ if pooled topo data range
is positive and negative, otherwise ‘Reds’ or ‘Blues’ depending on sign of
pooled data range)
Return the significant clusters at a given threshold.
Parameters:
thresh (float) – The threshold to consider a cluster significant eg 95 or 99
Returns:
clusters – A list containing the significant clusters. Each list item contains
a tuple of three items - the cluster statistic, the cluster
percentile relative to the null and the spatial/spectral indices of
the cluster.
Compute a group GLM-Epochs from a set of first-level GLM-Epochs.
Parameters:
inspectra (list, tuple) – A list containing either the filepaths of a set of saved GLM-Epochs
objects, or the GLM-Epochs objects themselves.
design_config (glmtools.design.DesignConfig) – The design specification for the group level model (Default value = None)
datainfo (dict) – Dictionary of data values to use as covariates. The length of each
covariate must match the number of input GLM-Epochs (Default value =
None)
metric ({'copes', or 'tsats'}) – Which metric to plot (Default value = ‘copes’)