Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
h-mayorquin opened this issue Dec 9, 2024 · 3 comments · May be fixed by #1609
Open

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

h-mayorquin opened this issue Dec 9, 2024 · 3 comments · May be fixed by #1609
Milestone

Comments

@h-mayorquin
Copy link
Contributor

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.

@bendichter
Copy link
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

@h-mayorquin
Copy link
Contributor Author

Someone asking about the feature on the SpikeGLX issue tracker:

billkarsh/SpikeGLX#11

(presumably indicates some minority uses the feature)

@h-mayorquin h-mayorquin linked a pull request Dec 10, 2024 that will close this issue
@h-mayorquin
Copy link
Contributor Author

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

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.

@zm711 zm711 added this to the 0.14.0 milestone Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants