BasePipe#
- class sleepeegpy.base.BasePipe(*, prec_pipe=None, path_to_eeg=_Nothing.NOTHING, output_dir=_Nothing.NOTHING)[source]#
Bases:
ABC
A base class for all per-subject pipeline segments.
Methods:
A wrapper for
mne.io.Raw.interpolate_bads()
A wrapper for
mne.io.Raw.plot()
.A wrapper for
mne.viz.plot_sensors()
with a legend.A wrapper for
mne.io.Raw.save()
.A wrapper for
mne.io.Raw.set_eeg_reference()
.Attributes:
Calculates percent of data segments annotated as BAD.
A wrapper for
raw.info["sfreq"]
.Preceding pipe that hands over mne_raw object and output_dir.
Can be any eeg file type supported by
mne.io.read_raw()
.Path to the directory where the output will be saved.
An instanse of
mne.io.Raw
.-
prec_pipe:
Type
[TypeVar
(BasePipeType
, bound= BasePipe)]# Preceding pipe that hands over mne_raw object and output_dir.
-
path_to_eeg:
Path
# Can be any eeg file type supported by
mne.io.read_raw()
.
-
output_dir:
Path
# Path to the directory where the output will be saved.
-
mne_raw:
Raw
# An instanse of
mne.io.Raw
.
- property sf[source]#
A wrapper for
raw.info["sfreq"]
.- Returns:
sampling frequency
- Return type:
float
- property bad_data_percent[source]#
Calculates percent of data segments annotated as BAD.
- Returns:
percent of bad data spans in raw data
- Return type:
float
- interpolate_bads(**interp_kwargs)[source]#
A wrapper for
mne.io.Raw.interpolate_bads()
- Parameters:
**interp_kwargs – Arguments passed to
mne.io.Raw.interpolate_bads()
.
- plot(save_annotations=False, save_bad_channels=False, overwrite=False, **kwargs)[source]#
A wrapper for
mne.io.Raw.plot()
.- Parameters:
save_annotations (
bool
) – Whether to save annotations as txt. Defaults to False.save_bad_channels (
bool
) – Whether to save bad channels as txt. Defaults to False.overwrite (
bool
) – Whether to overwrite annotations and bad_channels files if exist. Defaults to False.**kwargs – Arguments passed to
mne.io.Raw.plot()
.
- plot_sensors(legend=None, legend_args=None, **kwargs)[source]#
A wrapper for
mne.viz.plot_sensors()
with a legend.- Parameters:
legend (
Iterable
[str
]) – ch_groups names to connect to colors. Defaults to None.legend_args (
dict
) – Arguments passed tomatplotlib.axes.Axes.legend()
. Defaults to None.**kwargs – Arguments passed to
mne.viz.plot_sensors()
.
- save_raw(fname, **kwargs)[source]#
A wrapper for
mne.io.Raw.save()
.- Parameters:
fname (
str
) – Filename for the fif file being saved.**kwargs – Arguments passed to
mne.io.Raw.save()
.
- set_eeg_reference(ref_channels='average', projection=False, **kwargs)[source]#
A wrapper for
mne.io.Raw.set_eeg_reference()
.- Parameters:
ref_channels –
ref_channels
. Defaults to ‘average’.projection –
projection
. Defaults to False.**kwargs – Additional arguments passed to
mne.io.Raw.set_eeg_reference()
.
-
prec_pipe: