Skip to content

Fix spikeglx stream for isolated folder from multi probe case. - #1661

Merged
zm711 merged 6 commits into
NeuralEnsemble:masterfrom
h-mayorquin:fix_spikeglx
Mar 26, 2025
Merged

Fix spikeglx stream for isolated folder from multi probe case.#1661
zm711 merged 6 commits into
NeuralEnsemble:masterfrom
h-mayorquin:fix_spikeglx

Conversation

@h-mayorquin

@h-mayorquin h-mayorquin commented Mar 20, 2025

Copy link
Copy Markdown
Contributor

Should fix #1661
See discussion here: #1656
Added a test as @zm711 requested.

This is restoring some behavior that we lost after #1608

Plus, reading the metadata history changes here:
https://billkarsh.github.io/SpikeGLX/help/parsing/

Calculating device_index through the original file name is robust up till the phase 3A whereas the current probe_index calculation might fail for some phases. So I think this is a good improvement overall and simplifies the code.

@zm711

zm711 commented Mar 20, 2025

Copy link
Copy Markdown
Contributor

@guptadivyansh, so this was a loading regression that occurred. So we also want to fix this. Depending on which PR gets merged first you two might end up with some conflicts. So just want you to take a look at the tweak we are making here as well.

@zm711
zm711 requested a review from alejoe91 March 24, 2025 18:06
for info in info_list:
if info.get("device") == "nidq":
info["device_index"] = "" # TODO: Handle multi nidq case, maybe use meta["typeNiEnabled"]
if info.get("device_kind") == "imec":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why switch back to imec. Just so I can better understand this for the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just switch the order of the if here and the diff is not working as it should.

But overall, instead of calculating the stream_index by considering all the possible configurations of probe, dock, slot we are just parsing it from the file name that is written on the metadata.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I'm just showing off my total ignorance of this IO. I see how you flipped it now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a comment saying the options are nidq or imec above the if-else? In case other devs work on this in the future??

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to suggest a line that would make it easier for you as you are in a better position to judge what's helpful.

I will revisit this once we are adding support for one box data:

https://www.neuropixels.org/_files/ugd/328966_9d776efdcff74658a3724690610d4b41.pdf

Comment thread neo/rawio/spikeglxrawio.py
@zm711

zm711 commented Mar 25, 2025

Copy link
Copy Markdown
Contributor

@grahamfindlay do you have a moment to test this PR really quick? Since we are just reverting due to lost behavior and we've added a test I feel like we are in a good place, but having an end-user test would be awesome.

@grahamfindlay

Copy link
Copy Markdown

@zm711 it works for me!

@zm711

zm711 commented Mar 26, 2025

Copy link
Copy Markdown
Contributor

Great fixing the CI tomorrow-ish and then we can merge after we retest :)

zm711 and others added 3 commits March 26, 2025 09:05
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>

@zm711 zm711 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two separate users confirm this fixes the regression. Merging.

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 this pull request may close these issues.

3 participants