NeurodataWithoutBorders / nwb-schema

Data format specification schema for the NWB neurophysiology data format
http://nwb-schema.readthedocs.io
Other
52 stars 16 forks source link

Add Events type #301

Open rly opened 4 years ago

rly commented 4 years ago

It is often useful to store events as a list of timestamps, without packaging them into a TimeSeries. For example, this list could represent when the animal receives reward, when the animal performs a particular behavior, etc. This is different from TimeIntervals because there is no stop time; these are instantaneous events. Also, TimeIntervals has the baggage of being a DynamicTable. This is simpler than AnnotationSeries which has all the baggage of being a TimeSeries.

@bendichter and I propose two new types for nwb.event.yaml:

rly commented 4 years ago

See also related discussion about TTL pulses in #306

rly commented 4 years ago

It is also worth noting that the schema includes neurodata_types BehavioralEpochs, BehavioralEvents, and BehavioralTimeSeries, which contain any number of IntervalSeries (a TimeSeries), TimeSeries, and TimeSeries objects, respectively. In particular, it seems BehavioralEvents is meant to store irregular event times in a collection of TimeSeries objects.

rly commented 4 years ago

The need for an Events/LabeledEvents/TTL pulse data type has come up multiple times recently. Here is a summary of possible options to move forward:

Option 1: See #302 for a proposal to add:

Pros:

Cons:

Option 2:

Pros:

Cons:

Option 3: A hybrid between Options 1 and 2.

Pros:

Cons:

Option 4: Create a subtype of TimeSeries or BehavioralTimeSeries or AnnotationSeries where the 'data' dataset are all ones.

Pros:

Cons:


I am in favor of option 3. Thoughts, @bendichter @oruebel @ajtritt?

Finally, whichever route we choose, should we make an extension or just build this into the next minor version of NWB? I am in favor of building it in, since we know this will have high usage.

bendichter commented 4 years ago

Thanks for really thinking this through and laying it out. I also like 3 and I'd vote for extension because it will allow us to start using this sooner and to vet it before releasing it.

oruebel commented 4 years ago

I think developing this as an extension first and then merging in once it has been evaluated is probably the way to go, given that there a few options. The extension can be versioned at 0.x throughout and it can be made explicit that it is not intended for production use, but as an evolving proposal for integration with NWB.

rly commented 4 years ago

Update: The proposed Events and LabeledEvents types will be implemented in an NDX extension in development here: https://github.com/rly/ndx-events