Skip to content

Multi-gate and multi-trigger t_starts in SpikeGLX are incorrectly set to 0 #1607

Closed

Description

@h-mayorquin

As discussed with @samuelgarcia the starting time of the segments in SpikeGLX are set to 0 here:

# deal with nb_segment and t_start/t_stop per segment
self._t_starts = {seg_index: 0.0 for seg_index in range(nb_segment)}
self._t_stops = {seg_index: 0.0 for seg_index in range(nb_segment)}
for seg_index in range(nb_segment):
for stream_name in stream_names:
info = self.signals_info_dict[seg_index, stream_name]
t_stop = info["sample_length"] / info["sampling_rate"]
self._t_stops[seg_index] = max(self._t_stops[seg_index], t_stop)

But in the metadata there is a firstFrame value:

https://billkarsh.github.io/SpikeGLX/Sgl_help/Metadata_30.html

firstSample=779283
All acquired samples are assigned an index number; the first acquired during the run is sample 0. This value is the index number of the first sample recorded in this file.

This is important so the correct times can be propagated to downstream applications.

We have data on gin that has this metadata so I can submit a patch.

Activity

  1. bendichter commented on Dec 9, 2024

    @bendichter
    Contributor

    I am not aware of anyone using gates and triggers but let's throw a warning indicating that the starting time of each segment will be inaccurate

  2. h-mayorquin commented on Dec 10, 2024

    @h-mayorquin
    ContributorAuthor

    Someone asking about the feature on the SpikeGLX issue tracker:

    billkarsh/SpikeGLX#11

    (presumably indicates some minority uses the feature)

  3. h-mayorquin commented on Dec 10, 2024

    @h-mayorquin
    ContributorAuthor

    Jennifer Colonel also mentioned that she has trained many labs (unspecified) that use these features.

    While fixing some metadata issues on neuroconv I realize that not even the t_start of the multi-probe is correctly set. The fix in #1609 should take care of all the cases.

  4. added this to the 0.14.0 milestone on Dec 13, 2024
  5. modified the milestones: 0.14.0, 0.14.1 on Mar 28, 2025
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions