pyheartlib.data_arrhythmia
Module Contents
Classes
Processes ECG records to make a dataset holding records along with |
Attributes
- pyheartlib.data_arrhythmia.msg = 'Module data_arrhythmia will be deprecated in future versions. Use module data_rhythm instead.'
- pyheartlib.data_arrhythmia.msg = 'ArrhythmiaData class will be deprecated. Use RhythmData class instead.'
- class pyheartlib.data_arrhythmia.ArrhythmiaData(*args, **kwargs)
Bases:
pyheartlib.data_rhythm.RhythmDataProcesses ECG records to make a dataset holding records along with metadata about signal excerpts.
It has a method that can generate metadata for signal excerpts. The metadata are generated using the sliding window approach. For each excerpt of a signal the onset, offset, and its annotation is recorded. The metadata list for an excerpt is structured as: [record_id, onset, offset, annotation]. Annotation for an excerpt is a single label. Example metadata for an excerpt: [10, 500, 800, ‘AFIB’].
- Parameters:
base_path (str, optional) – Path of the main directory for storing the original and processed data, by default None
remove_bl (bool, optional) – If True, the baseline wander is removed from the original signals prior to extracting excerpts, by default False
lowpass (bool, optional) – Whether or not to apply low-pass filter to the original signals, by default False
cutoff (int, optional) – Parameter of the low pass-filter, by default 45
order (int, optional) – Parameter of the low pass-filter, by default 15
progress_bar (bool, optional) – Whether to display a progress bar, by default True
processors (list, optional) – Ordered list of functions’ names for preprocessing the raw signals. Each function takes a one-dimensional NumPy array as its input and returns an array of the same length.
Example
>>> from pyheartlib.data_rhythm import RhythmData >>> # Make an instance of the RhythmData >>> rhythm_data = RhythmData( >>> base_path="data", remove_bl=False, lowpass=False, >>> progress_bar=False) >>> # Define records >>> train_set = [201, 203] >>> # Create the dataset >>> rhythm_data.save_dataset( >>> rec_list=train_set, file_name="train.arr", win_size=3600, stride=64 >>> )