gedai.gedai.Gedai🔗
- class gedai.gedai.Gedai[source]🔗
Generalized Eigenvalue De-Artifacting Instrument (GEDAI).
This class implements the single band GEDAI workflow. For wavelet-based decomposition, band-wise denoising use
MultibandGedai.See [1].
Warning
For EEG channels, Gedai will set average reference internally to match the leadfield covariance reference. Gedai will not modify the input data in-place, but will create copies when necessary to ensure the original data remains unchanged.
Attributes
Get the channel names used during fitting.
Methods
fit_epochs(epochs[, picks, reference_cov, ...])Fit the GEDAI model to the epochs data.
fit_raw(raw[, picks, 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[, overlap, n_jobs, verbose])Transform raw data using the fitted model.
References
- fit_epochs(epochs, picks='eeg', 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.
- picks
str|list|slice Channels to include. Note that all channels selected must have the same type. Slices and lists of integers will be interpreted as channel indices. In lists, channel name strings (e.g.
['Fp1', 'Fp2']) will pick the given channels. Can also be the string values"all"to pick all channels, or"data"to pick data channels. The default is"eeg"to pick all EEG channels.- reference_cov
str|mne.Covariance The reference covariance to use. If
'leadfield', use a pre-computed covariance. The precomputed covariance if computed from a leadfield made using 1005 EEG channels layout and fsaverage head model. Ifmne.Covariance, use a pre-computed covariance. Seecompute_covariance_from_forward()for more details on how to compute a covariance from a forward solution.- 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, use all available CPU cores. If1orNone, computations are run serially.- 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, picks='eeg', duration=1.0, overlap=0.75, 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.
- picks
str|list|slice Channels to include. Note that all channels selected must have the same type. Slices and lists of integers will be interpreted as channel indices. In lists, channel name strings (e.g.
['Fp1', 'Fp2']) will pick the given channels. Can also be the string values"all"to pick all channels, or"data"to pick data channels. The default is"eeg"to pick all EEG channels.- duration
float Duration of each epoch in seconds. The default is
1.0.- overlap
float The overlap ratio between consecutive epochs, between
0and1. The default is0.5(50%% overlap). For example,0.5means 50%% overlap and0.75means 75%% overlap.- reject_by_annotation
bool Whether annotated bad segments should be rejected. It is recommended to set this to
Falsefor fitting, since the algorithm needs to learn from bad segments. The default isFalse.- reference_cov
str|mne.Covariance The reference covariance to use. If
'leadfield', use a pre-computed covariance. The precomputed covariance if computed from a leadfield made using 1005 EEG channels layout and fsaverage head model. Ifmne.Covariance, use a pre-computed covariance. Seecompute_covariance_from_forward()for more details on how to compute a covariance from a forward solution.- 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, use all available CPU cores. If1orNone, computations are run serially.- 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, use all available CPU cores. If1orNone, computations are run serially.- 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, overlap=0.75, 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.
- overlap
float The overlap ratio between consecutive epochs, between
0and1. The default is0.5(50%% overlap). For example,0.5means 50%% overlap and0.75means 75%% overlap.- n_jobs
int|None The number of jobs to run in parallel. If
-1, use all available CPU cores. If1orNone, computations are run serially.- 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
- property ch_names🔗
Get the channel names used during fitting.