Skip to content

[Feature]: Add optional device linking to TimeSeries #602

Open

Description

@h-mayorquin

This relates to writing data from NIDQ devices in the context of a SpikeGLX recording. A more complete discussion can be found here.

To summarize:

Analog channels from NIDQ devices can represent a variety of non-neural signals (e.g., motion, temperature, MEG). It’s unclear how best to store this information. One option is to save every channel as a separate TimeSeries (e.g., TimeSeriesMotionChannel1, TimeSeriesTemperatureChannel2, TimeSeriesMEGChannel3, etc.). This approach allows the TimeSeries description to include all necessary information and also to use other fields such as gains, offsets, and units for better provenance.

However, this approach has a downside: there is currently no formal way to indicate that all of these TimeSeries were recorded from the same device (the NIDQ board). I think it would be good for provenance if we had the option to link a TimeSeries object to a Device.

What do you think? Am I missing something?

Code of Conduct

Activity

  1. added this to the Future milestone on Dec 12, 2024
  2. added
    priority: mediumnon-critical problem and/or affecting only a small set of NWB users
    on Dec 12, 2024
  3. stephprince commented on Dec 13, 2024

    @stephprince
    Contributor

    thanks for the issue @h-mayorquin

    @rly @oruebel and I discussed this yesterday and think it's a good idea but we would need to investigate further to make a plan for the exact implementation.

    One point that came up was that there are some TimeSeries that are not directly generated from a device but instead from a preprocessing step or script. In these cases having the option to link a device may not be appropriate.

    One option to address this is to create a new intermediate TimeSeries type (e.g. "RecordedTimeSeries") that allows this optional device linking. To start implementing this approach, we should first take a look through all the types that inherit from TimeSeries and determine which ones would be a "RecordedTimeSeries" with optional Device linking vs. the current definition of TimeSeries without Device linking.

  4. h-mayorquin commented on Dec 13, 2024

    @h-mayorquin
    ContributorAuthor

    Hi guys, thanks for discussing my issue.

    Yes, I thought that a sub-type of TimeSeries would be less disruptive since TimeSeries is so fundamental. You might not want a device on some of the children of TimeSeries for example. Slightly related would be the proposal of @rly here to separate Neural from Non-neural ElectricalSeries which could solve this problem as well (although, note the NIDQ electrical series should not be linked to electrodes).

    The other possible solution to the NIDQ metadata problem would be to add a way of annotating channels. That way, I can use a single TimeSeries but then annotate the modality of each channel there. This goes close to the Xarray model of labeling dimensions and rows which might be nice but I guess that would require a big discussion among you guys.

  5. h-mayorquin commented on Sep 3, 2025

    @h-mayorquin
    ContributorAuthor

    Thinking more about this, what about just adding an Optional device link?

  6. modified the milestones: Future, 2.10.0 on Dec 11, 2025
  7. rly commented on Dec 11, 2025

    @rly
    Contributor

    Revisiting this discussion, we think it would be fine to add an optional link from TimeSeries to Device, and document specifically that the linked Device was used to record the time series data (instead of saying the time series was sent to the device for stimulation). No need for a new subtype.

    We may want to add some consistency checks for types that already have a link to Device like PatchClampSeries.electrode links to a Device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: enhancementimprovements of code or code behaviorpriority: mediumnon-critical problem and/or affecting only a small set of NWB users

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions