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_typestr

Wavelet to use for the decomposition. The default is ‘haar’. See pywt.wavedec() for complete list of available wavelet values.

wavelet_levelint

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_cutofffloat | None

If float, zero out all wavelet levels (i.e frequency bands) whose upper frequency bound is below this cutoff frequency (in Hz). If None, no frequency band is zeroed out. The default is None.

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:
epochsmne.Epochs

The epochs data to fit the model to.

reference_covstr

The reference covariance to use. Only ‘leadfield’ is supported for now.

sensai_methodstr

The method to use for threshold optimization. Can be ‘gridsearch’ or ‘optimize’. The default is ‘optimize’.

noise_multiplierfloat

The noise multiplier to use for artefact threshold rejection optimization.

n_jobsint | None

The number of jobs to run in parallel. If -1, it is set to the number of CPU cores. Requires the joblib package. None (default) is a marker for ‘unset’ that will be interpreted as n_jobs=1 (sequential execution) unless the call is performed under a joblib.parallel_config context manager that sets another value for n_jobs.

verboseint | 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.

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:
rawmne.io.BaseRaw

The raw data to fit the model to.

durationfloat

Duration of each epoch in seconds (default 1.0). Will be automatically adjusted to the closest valid duration for the wavelet level.

overlapfloat

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_annotationbool

Whether to reject epochs based on annotations. Default is False.

reference_covstr

The reference covariance to use. Only ‘leadfield’ is supported for now.

sensai_methodstr

The method to use for threshold optimization. Can be ‘gridsearch’ or ‘optimize’. The default is ‘optimize’.

noise_multiplierfloat

The noise multiplier to use for artefact threshold rejection optimization.

n_jobsint | None

The number of jobs to run in parallel. If -1, it is set to the number of CPU cores. Requires the joblib package. None (default) is a marker for ‘unset’ that will be interpreted as n_jobs=1 (sequential execution) unless the call is performed under a joblib.parallel_config context manager that sets another value for n_jobs.

verboseint | 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.

plot_fit()[source]🔗

Plot the fitting results.

Returns:
figslist of matplotlib.figure.Figure

The list of figures showing the fitting results.

transform_epochs(epochs, n_jobs=None, verbose=None)[source]🔗

Transform epochs data using the fitted model.

Parameters:
epochsmne.Epochs

The epochs to transform.

n_jobsint | None

The number of jobs to run in parallel. If -1, it is set to the number of CPU cores. Requires the joblib package. None (default) is a marker for ‘unset’ that will be interpreted as n_jobs=1 (sequential execution) unless the call is performed under a joblib.parallel_config context manager that sets another value for n_jobs.

verboseint | 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.

Returns:
epochsmne.Epochs

The transformed epochs.

transform_raw(raw, duration=1.0, overlap=0.5, n_jobs=None, verbose=None)[source]🔗

Transform raw data using the fitted model.

Parameters:
rawmne.io.BaseRaw

The raw data to fit the model to.

durationfloat

Duration of each epoch in seconds (default 1.0). Will be automatically adjusted to the closest valid duration for the wavelet level.

overlapfloat

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_jobsint | None

The number of jobs to run in parallel. If -1, it is set to the number of CPU cores. Requires the joblib package. None (default) is a marker for ‘unset’ that will be interpreted as n_jobs=1 (sequential execution) unless the call is performed under a joblib.parallel_config context manager that sets another value for n_jobs.

verboseint | 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.

Returns:
raw_correctedmne.io.BaseRaw

The corrected raw data.