The Sensor-S study investigates stroke rehabilitation and patient engagement using wearable devices. This repository accompanies the iWOAR short paper and contains preprocessing pipelines and data quality assessment functions for wearable sensor data collected in Sensor-S.
The repository includes preprocessing and quality assessment code for the following modalities from the Samsung Galaxy Watch6:
- Heart rate
- Skin temperature
- Steps
- ECG
In addition, the repository includes preprocessing code for the Dexcom G7 continuous glucose monitoring (CGM) sensor:
- Interstitial glucose (IGLU)
The main focus of this repository is to transform raw wearable data into cleaned, quality-assessed signals that can be used for subsequent biomarker extraction and analysis.
The main package is located in the folder:
samsung6_prep/
This folder is structured as a Python package and contains modality-specific preprocessing and quality assessment functions.
samsung6_prep/
├── ecg/
├── igluc/
├── heartrate/
├── steps/
├── temp/
├── utils/
└── plotting/
Modality-specific folders
Each modality folder contains preprocessing and quality assessment functions for the corresponding signal:
- ecg/: ECG preprocessing functions and quality assessment functions
- igluc/: IGLU preprocessing functions and quality assessment functions
- heartrate/: Heart rate preprocessing functions and quality assessment functions
- steps/: Step count preprocessing functions and quality assessment functions
- temp/: Skin temperature preprocessing functions and quality assessment functions
Each modality folder contains a file named: <modality>_functions.py
The ecg/ folder additionally contains: biosppy_functions.py
This file contains adapted functions from the biosppy package.
The repository also contains the following helper folders:
- utils/: Functions for loading and saving data whiches uses the data loader class
- plotting/: Modality-specific plotting functions
The plotting/ folder contains files named: <modality>_plotting.py
The main preprocessing workflow is implemented in: pipeline.py
This script executes the preprocessing pipeline for the Sensor-S wearable data. It applies modality-specific preprocessing steps, quality checks, and artifact handling procedures where applicable.
This project uses https://python-poetry.org/ for dependency management.
The Python environment is defined by:
pyproject.toml
poetry.lock
The environment targets Python 3.10 to 3.13 and includes the analysis stack required for preprocessing, signal processing, plotting, and quality assessment.
- Install the project dependencies using Poetry:
poetry install - Activate the virtual environment:
poetry shell - Run a script inside of the enviroment:
poetry run python <script>.py
This repository does not contain any patient data.
Due to privacy and data protection requirements, raw and processed Sensor-S study data are not included in this repository. The code is intended to be applied to locally available Sensor-S data using the expected internal data structure.
The preprocessing functions are organized by modality and can be imported from the corresponding package folders. The recommended entry point for running the full preprocessing workflow is: pipeline.py
For development and testing, modality-specific functions can also be called directly from the respective folders.
The preprocessing pipeline includes modality-specific steps such as:
- Physiological boundary checks
- Noise filtering
- Artifact and outlier detection
- Interpolation or exclusion of invalid segments
- Quality metric calculation
- Biomarker-oriented feature preparation
The available preprocessing steps differ between modalities because ECG, heart rate, skin temperature, steps, and CGM data have different signal characteristics and artifact patterns.
If you use this repository, please cite the accompanying iWOAR short paper: