gedai.gedai.Gedai🔗
- class gedai.gedai.Gedai(wavelet_type='haar', wavelet_level=0, wavelet_low_cutoff=None)[source]🔗
Generalized Eigenvalue De-Artifacting Instrument (GEDAI).
- Parameters:
- wavelet_type
str Wavelet to use for the decomposition. The default is ‘haar’. See
pywt.wavedec()for complete list of available wavelet values.- wavelet_level
int Decomposition level (must be >= 0). The default is 0 (no decomposition). If 0 (default), no wavelet decomposition is performed. See
pywt.wavedec()more details.- wavelet_low_cutoff
float|None If
float, zero out all wavelet levels (i.e frequency bands) whose upper frequency bound is below this cutoff frequency (in Hz). IfNone, no frequency band is zeroed out. The default isNone.
- wavelet_type
Methods
fit_epochs(epochs[, reference_cov, ...])Fit the GEDAI model to the epochs data.
fit_raw(raw[, duration, overlap, ...])Fit the GEDAI model to the raw data.
plot_fit()Plot the fitting results.
transform_epochs(epochs[, n_jobs, verbose])Transform epochs data using the fitted model.
transform_raw(raw[, duration, overlap, ...])Transform raw data using the fitted model.
References
- fit_epochs(epochs, reference_cov='leadfield', sensai_method='optimize', noise_multiplier=3.0, n_jobs=None, verbose=None)[source]🔗
Fit the GEDAI model to the epochs data.
- Parameters:
- epochs
mne.Epochs The epochs data to fit the model to.
- reference_cov
str The reference covariance to use. Only ‘leadfield’ is supported for now.
- sensai_method
str The method to use for threshold optimization. Can be ‘gridsearch’ or ‘optimize’. The default is ‘optimize’.
- noise_multiplier
float The noise multiplier to use for artefact threshold rejection optimization.
- n_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.- verbose
int|str|bool|None Sets the verbosity level. The verbosity increases gradually between
"CRITICAL","ERROR","WARNING","INFO"and"DEBUG". If None is provided, the verbosity is set to"WARNING". If a bool is provided, the verbosity is set to"WARNING"for False and to"INFO"for True.
- epochs
- fit_raw(raw, duration=1.0, overlap=0.5, reject_by_annotation=False, reference_cov='leadfield', sensai_method='optimize', noise_multiplier=3.0, n_jobs=None, verbose=None)[source]🔗
Fit the GEDAI model to the raw data.
- Parameters:
- raw
mne.io.BaseRaw The raw data to fit the model to.
- duration
float Duration of each epoch in seconds (default 1.0). Will be automatically adjusted to the closest valid duration for the wavelet level.
- overlap
float The overlap ratio between epochs (0 to 1). Default is 0.5 (50% overlap). For example, 0.5 means 50% overlap, 0.75 means 75% overlap.
- reject_by_annotation
bool Whether to reject epochs based on annotations. Default is False.
- reference_cov
str The reference covariance to use. Only ‘leadfield’ is supported for now.
- sensai_method
str The method to use for threshold optimization. Can be ‘gridsearch’ or ‘optimize’. The default is ‘optimize’.
- noise_multiplier
float The noise multiplier to use for artefact threshold rejection optimization.
- n_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.- verbose
int|str|bool|None Sets the verbosity level. The verbosity increases gradually between
"CRITICAL","ERROR","WARNING","INFO"and"DEBUG". If None is provided, the verbosity is set to"WARNING". If a bool is provided, the verbosity is set to"WARNING"for False and to"INFO"for True.
- raw
- plot_fit()[source]🔗
Plot the fitting results.
- Returns:
- figs
listofmatplotlib.figure.Figure The list of figures showing the fitting results.
- figs
- transform_epochs(epochs, n_jobs=None, verbose=None)[source]🔗
Transform epochs data using the fitted model.
- Parameters:
- epochs
mne.Epochs The epochs to transform.
- n_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.- verbose
int|str|bool|None Sets the verbosity level. The verbosity increases gradually between
"CRITICAL","ERROR","WARNING","INFO"and"DEBUG". If None is provided, the verbosity is set to"WARNING". If a bool is provided, the verbosity is set to"WARNING"for False and to"INFO"for True.
- epochs
- Returns:
- epochs
mne.Epochs The transformed epochs.
- epochs
- transform_raw(raw, duration=1.0, overlap=0.5, n_jobs=None, verbose=None)[source]🔗
Transform raw data using the fitted model.
- Parameters:
- raw
mne.io.BaseRaw The raw data to fit the model to.
- duration
float Duration of each epoch in seconds (default 1.0). Will be automatically adjusted to the closest valid duration for the wavelet level.
- overlap
float The overlap ratio between epochs (0 to 1). Default is 0.5 (50% overlap). For example, 0.5 means 50% overlap, 0.75 means 75% overlap.
- n_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.- verbose
int|str|bool|None Sets the verbosity level. The verbosity increases gradually between
"CRITICAL","ERROR","WARNING","INFO"and"DEBUG". If None is provided, the verbosity is set to"WARNING". If a bool is provided, the verbosity is set to"WARNING"for False and to"INFO"for True.
- raw
- Returns:
- raw_corrected
mne.io.BaseRaw The corrected raw data.
- raw_corrected