sleeplab_format.extractor.cli
CLI for extracting and preprocessing a subset of data in sleeplab format.
extract(src_dir, dst_dir, cfg)
Read, preprocess, and write data in sleeplab format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src_dir |
Path
|
The source SLF dataset folder. |
required |
dst_dir |
Path
|
The root folder where the extracted dataset will be saved. |
required |
cfg |
DatasetConfig
|
The extractor config. |
required |
Source code in src/sleeplab_format/extractor/cli.py
sleeplab_format.extractor.preprocess
highpass(s, attributes, *, cutoff, dtype=np.float32)
lowpass(s, attributes, *, cutoff, dtype=np.float32)
resample_polyphase(s, attributes, *, fs_new, dtype=np.float32)
Resample the signal using scipy.signal.resample_polyphase.
Source code in src/sleeplab_format/extractor/preprocess.py
decimate(s, attributes, *, fs_new, dtype=np.float32)
Source code in src/sleeplab_format/extractor/preprocess.py
upsample_linear(s, attributes, *, fs_new, dtype=np.float32)
Linear interpolation for upsampling signals such as SpO2.
Source code in src/sleeplab_format/extractor/preprocess.py
iqr_norm(s, attributes, dtype=np.float32)
Interquartile range standardization for the signal.