This is an NWB extension for storing timestamped event data and TTL pulses.
The latest version is 0.3.0. This is a major change from previous versions.
Events can be:
- Simple events. These are stored in the
Events
type. TheEvents
type consists of only a name, a description, and a 1D array of timestamps. This should be used instead of aTimeSeries
when the time series has no data. - Labeled events. These are stored in the
LabeledEvents
type. TheLabeledEvents
type expands on theEvents
type by adding 1) a 1D array of integer values (data) with the same length as the timestamps and 2) a 1D array of labels (labels) associated with each unique integer value in the data array. The data values are indices into the array of labels. TheLabeledEvents
type can be used to encode additional information about individual events, such as the reward values for each reward event. - TTL pulses. These are stored in the
TTLs
type. TheTTLs
type is a subtype of theLabeledEvents
type specifically for TTL pulse data. A single instance should be used for all TTL pulse data. The pulse value (or channel) should be stored in the 1D data array, and the labels associated with each pulse value (or channel) should be stored in the 1D array of labels. - Annotated events. These are stored in the
AnnotatedEventsTable
type. TheAnnotatedEventsTable
type is a subtype ofDynamicTable
, where each row corresponds to a different event type. The table has a ragged (variable-length) 1D column of event times, such that each event type (row) is associated with an array of event times. Unlike for the other event types, users can add their own custom columns to annotate each event type or event time. This can be useful for storing event metadata related to data preprocessing and analysis, such as marking bad events.
This extension was developed by Ryan Ly, Oliver Rübel, and the NWB Technical Advisory Board. Information about the rationale, background, and alternative approaches to this extension can be found here: https://docs.google.com/document/d/1qcsjyFVX9oI_746RdMoDdmQPu940s0YtDjb1en1Xtdw
Python:
pip install -U ndx-events
Matlab:
generateExtension('<directory path>/ndx-events/spec/ndx-events.namespace.yaml');
In a Python 3.8-3.12 environment:
pip install -r requirements-dev.txt
pip install -e .
Run tests:
pytest
Install pre-commit hooks:
pre-commit install
Style and other checks:
black .
ruff .
codespell .
Python:
This extension was created using ndx-template.