Read multiple signals from different sources.
Project description
Documentation
https://hpi-dhc.github.io/devicely/
Description
Package containing readers
for reading data from different devices.
You can also timeshift
the data to a specified interval and write
the data back.
For a sample dataset go to: https://doi.org/10.6084/m9.figshare.12646217
So far, we have integrated:
Empatica E4 (Firmware 2.1.0.4911)
Biovotion Everion (Firmware 03.06)
1-lead ECG monitor FarosTM 180 from Bittium (Firmware 3.5.1)
Spacelabs (SL 90217)
Tags (obtained from the app: TimeStamp for Android Version 1.36)
Shimmer Consensys GSR (Shimmer3 GSR Development Kit)
Basic Usage
To use the package, after cloning this repository:
pip install .
Then:
import devicely
Example
shift = pd.Timedelta(15,unit='d')
Tags
Reading Tags from the TimeStamp App
Timeshifting and Writing them back
tags = devicely.TagReader(tags_path)
tags.data.head()
tags.timeshift(shift)
tags.data.head()
tags.write(join(write_path, 'tags.csv'))
Empatica
Reading Empatica E4 Data
Timeshifting and Writing them back
empatica = devicely.EmpaticaReader(empatica_path)
empatica.data.head()
empatica.timeshift(shift)
empatica.data.head()
empatica.write(join(write_path, 'Empatica'))
Faros
Reading Bittium Faros 180 Data
Timeshifting and Writing them back
faros = devicely.FarosReader(faros_path)
faros.data.head()
faros.timeshift(shift)
faros.data.head()
faros.write(join(write_path, 'faros.csv'))
Biovotion
Reading Biovotion Everion Data
Timeshifting and Writing them back
- The reader method detects automatically if the
sensors
file is present or not.
everion = devicely.EverionReader(everion_path)
everion.data.head()
everion.timeshift(shift)
everion.data.head()
everion.write(join(write_path, 'Everion'))
Spacelabs
Reading Spacelabs Data
Timeshifting, Deidentifying and Writing them back
-
The method deidentify generates a
random
subject id or you can specify one (e.g. 001) -
The method
drop_EB
will drop lines with anEB
error -
The method
set_window
will create atimedelta
window around the blood pressure measurement (e.g. 30 secs)- The type of window is defined by:
bfill
(before the start of the measurement),bffil
(half before and half after) offfill
(after the start of the measurement)
- The type of window is defined by:
spacelabs = devicely.SpacelabsReader(spacelabs_path)
spacelabs.data.head()
spacelabs.timeshift(shift)
spacelabs.deidentify('001')
spacelabs.drop_EB()
spacelabs.data.head()
spacelabs.set_window(timedelta(seconds=30), 'bfill')
spacelabs.data.head()
spacelabs.write(join(write_path, 'spacelabs.abp'))
Shimmer
Reading Shimmer Consensys GSR (Shimmer3 GSR Development Kit)
Timeshifting and Writing them back
- Please define your
csv
delimiter (e.g.,
;
\t
) in the reader method
shimmer_plus = devicely.ShimmerPlusReader(shimmer_file_path, delimiter=';')
shimmer_plus.data.head()
shimmer_plus.timeshift(shift)
shimmer_plus.data.head()
shimmer_plus.write(join(write_path, 'shimmer_plus.csv'))
To run a notebook with examples:
pipenv install
pipenv shell
pipenv run jupyter notebook
And open example.ipynb
Contributors
* Ariane Sasso
* Arpita Kappattanavar
* Bjarne Pfitzner
* Felix Musmann
* Jost Morgenstern
* Lin Zhou
* Pascal Hecker
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.