Skip to main content

Store data from human wearables

Project description

ndx-wearables Extension for NWB

Store data from wearable devices in NWB

This extension is designed to help store data collected from a wide variety of wearable devices in a cross-device capable way, and with an eye towards clinical applications. For more details about the extension, see the paper "NDX-Wearables: An NWB Extension for Clinical Neuroscience" (to be presented at NER 2025).

Installation

Create a new Python environment. Python 3.11 works well, python 3.8-3.12 have been tested.

conda create -n <env_name> python=3.11

You should be able to install from pypi using pip install ndx-wearables

If you would like to install and contribute to developing the package, follow the instructions below in Installing in editable mode

Usage

To see how the data stored using this extension looks, visit our example dataset on the EMBER Archive.

You can also generate a local copy of a synthetic datasets by running the relevant examples/ scripts, for instance

python examples/activity_classification.py

Notes on Extension Usage

This extension provides three key classes (WearableTimeSeries, WearableEnumSeries, WearableEvents) to cover:

  • WearableTimeSeries for general time series data sampled from a wearable device, such as blood oxygenation level
  • WearableEnumSeries for categorical variables over time with pre-defined meanings (for example sleep stages over time)
  • WearableEvents for sparse events over long time periods (e.g. exercise events)

In addition to these classes, metadata may be required, including:

  • wearable_device is required for classes that link to a device
  • algorithm is required for many classes to indicate how the data was derived

The PhysiologicalMeasure class is povided to group together similar physiological measurements (e.g. heart rate variability, motion) from different devices/sources. This could include redundant measurements of the same physiological variable, or multiple measurements which will be fused by later processing to estimate an unknown quantity (e.g. multiple accelerometer measurements).

If these arguments are omitted, instantiating the class will raise an error. You can find working examples in the scripts under examples.

Arguments for ndx-wearables Classes

Class Name Required Arguments Optional Arguments
WearableTimeSeries name, description, data, timestamps, wearable_device, algorithm comments, resolution, conversion
WearableEnumSeries name, description, data, timestamps, wearable_device, meanings, algorithm resolution, conversion, comments
WearableEvents name, description, columns, wearable_device, algorithm resolution, conversion, comments

These reflect typical usage in constructors. For full context or updates, refer to the class definitions in src/pynwb/ndx_wearables and usage examples in examples.

Developing the extension

We use a gitflow model for collaborative development. Each feature should be created on a branch that branches off of the develop branch. Draft PRs back into develop should be open for each WIP feature, and marked as ready for review once the feature is complete. Periodic releases will be made from develop into main.

Installing in editable mode

Navigate to the project root cd path/to/ndx-wearables, then install the required dependencies. For developers, use:

pip install -r requirements-dev.txt

Custom extensions are added to the extension spec YAML file by running:

python src/spec/create_extension_spec.py

After running this script, you can verify that the extensions are correctly added to spec/ndx-wearables.extensions.yaml.

Running test code may be done with PyTest using the test files located in src/pynwb/tests.

To use custom extensions outside a PyTest setting, they must be registered by navigating to the directory root and installing the package:

cd path/to/ndx-wearables
pip install -e .

This extension was created using ndx-template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ndx_wearables-0.2.0.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ndx_wearables-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file ndx_wearables-0.2.0.tar.gz.

File metadata

  • Download URL: ndx_wearables-0.2.0.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ndx_wearables-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5a213daad7265fb2e732167994cb769f651b59e3115fa6561473dfd869f22c06
MD5 6f60985b2647209e9f222fe94a573d81
BLAKE2b-256 1ae27455df6367571e2f9cad93ee899aabc666e2f9476d1768b408238e0df8c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndx_wearables-0.2.0.tar.gz:

Publisher: publish-release.yaml on BCM-Neurosurgery/ndx-wearables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ndx_wearables-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ndx_wearables-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ndx_wearables-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e149679c5bd94f631f503c336ac6c7ccd025989001aff14117c2d6a8f9e8dd74
MD5 490f3894087effb54656272fae1ad87a
BLAKE2b-256 d5a90e1dade3b073afa564ecfc3fdb7ae8904ea41664a769278b2c317c52085f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ndx_wearables-0.2.0-py3-none-any.whl:

Publisher: publish-release.yaml on BCM-Neurosurgery/ndx-wearables

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page