yasa.SWResults#
- class yasa.SWResults(events, data, sf, ch_names, hypno, data_filt)#
Output class for slow-waves detection.
- Attributes:
- _events
pandas.DataFrame
Output detection dataframe
- _dataarray_like
EEG data of shape (n_chan, n_samples).
- _data_filtarray_like
Slow-wave filtered EEG data of shape (n_chan, n_samples).
- _sffloat
Sampling frequency of data.
- _ch_nameslist
Channel names.
- _hypnoarray_like or None
Sleep staging vector.
- _events
- __init__(events, data, sf, ch_names, hypno, data_filt)#
Methods
__init__
(events, data, sf, ch_names, hypno, ...)compare_channels
([score, max_distance_sec])Compare detected slow-waves across channels.
compare_detection
(other[, max_distance_sec, ...])Compare the detected slow-waves against either another YASA detection or against custom annotations (e.g. ground-truth human scoring).
find_cooccurring_spindles
(spindles[, lookaround])Given a spindles detection summary dataframe, find slow-waves that co-occur with sleep spindles.
get_coincidence_matrix
([scaled])Return the (scaled) coincidence matrix.
get_mask
()Return a boolean array indicating for each sample in data if this sample is part of a detected event (True) or not (False).
get_sync_events
([center, time_before, ...])Return the raw data of each detected event after centering to a specific timepoint.
plot_average
([center, hue, time_before, ...])Plot the average slow-wave.
plot_detection
()Plot an overlay of the detected slow-waves on the EEG signal.
summary
([grp_chan, grp_stage, mask, ...])Return a summary of the SW detection, optionally grouped across channels and/or stage.