PyLossless Configuration Classes¶
This is the docstring for the Lossless Config class. The methods and attributes detailed below are used to parse the YAML config file that is read by the Lossless Pipeline, and which contains the parameters to use for the pipeline.
PyLossless Config Class¶
- class pylossless.config.Config¶
Representation of configuration file for running the pipeline.
Methods
load_default([kind])Get the default pylossless config file.
- load_default(kind='adults')¶
Get the default pylossless config file.
- Parameters:
- kind
str|pathlib.Path Can be either ‘adults’ or ‘infants’. Default to ‘adults’.
- kind
Rejection Config Class¶
- class pylossless.config.RejectionPolicy(*, config_fname=None, ch_flags_to_reject='all', ic_flags_to_reject='all', ic_rejection_threshold=0.3, ch_cleaning_mode=None, interpolate_bads_kwargs=None, remove_flagged_ics=True)¶
Class used to implement a rejection policy for a pipeline output.
- Parameters:
- config_fname
pathlib.Path path to config file specifying the parameters to be used in for the rejection policy.
- ch_flags_to_reject
listofstr List of channel flags to apply. “all” is the same as
["noisy", "uncorrelated", "bridged"], meaning that any channels that have been flagged"noisy","uncorrelated", or"bridged"will be applied. Defaults to “all”.- ic_flags_to_reject
listofstr List of IC flags to apply. “all” is the same as
["muscle", "heart", "eye", "channel noise", "line noise"], meaning that any ICs that have been flagged"muscle","ecg","eog""channel_noise", or"line_noise"will be applied, if their label confidence is greater thanic_rejection_threshold. Note this list does NOT include"brain"and"other". Defaults to “all”.- ic_rejection_threshold
float threshold (between 0 and 1), representing the minimum confidence percentage in a given label (i.e., .30 is 30% confidence). For any labels passed to
ic_flags_to_reject(i.e."ecg","eog", etc.), ICs with that label and a confidence percentage greater than this threshold will be rejected. Defaults to0.3.- ch_cleaning_mode
str Must be one of
None,"drop", or"interpolate".Noneadds the channels toraw.info["bads"]."drop"drops the channels from theRawobject."interpolate"interpolates the bad channels. Defaults toNone.- interpolate_bads_kwargs
None|dict If
ch_cleaning_modeis"interpolate", these keyword arguments will be passed toraw.interpolate_bads(**interpolate_bads_kwargs). Must be a dictionary of valid keyword arguments forinterpolate_bads(). Defaults toNone, which means no keyword arguments will be passed.- remove_flagged_ics
bool If
True, subtracts the signal accounted for by the flagged ICs from therawobject, viaapply(). IfFalse, does nothing. Defaults toTrue.
- config_fname
Methods
apply(pipeline[, return_ica, version_mismatch])Return a cleaned new raw object based on the rejection policy.
- apply(pipeline, return_ica=False, version_mismatch='raise')¶
Return a cleaned new raw object based on the rejection policy.
- Parameters:
- Returns:
mne.io.RawAn
Rawinstance with the appropriate channels and ICs added to mne bads, interpolated, or dropped.