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

[feature request] Export to IBL Atlas tool? #2843

Open
jonahpearl opened this issue May 14, 2024 · 6 comments
Open

[feature request] Export to IBL Atlas tool? #2843

jonahpearl opened this issue May 14, 2024 · 6 comments
Labels
enhancement New feature or request exporters Related to exporters module

Comments

@jonahpearl
Copy link
Contributor

Hi Si folks — I'm wondering if there's a feature (or any plan to develop one) to allow exporting a recording to the IBL's neat Atlas Electrophysiology tool, which allows post-hoc realignment of probe tracks based on characteristics of the ephys data.

You can read their description of how to export data for their tool here. Unfortunately, it seems to only support data acquired with spikeGLX. I've been using open-ephys, so I'm out of luck, and it seems at least a few others have run into this problem before. As I wrote in that issue, it seems like the exported data is quite similar to what phy needs, and in the same format, so I imagine that si's export_to_phy function is a good starting point. (You can download example data here, "ephys_alignment_sample_data.zip").

I think there's a good chance that a few folks in my lab will develop an exporter for this if one doesn't already exist, but just checking in case someone has already done it...

Thank you!

@samuelgarcia
Copy link
Member

Hi,
feel free to propose a PR for implementing export_to_ibl().
The other way which is more work would be to patch this ibl data tools to support spikeinterface object directly as input!

@alejoe91
Copy link
Member

@jonahpearl We actually have some code lying around for this:
https://github.com/AllenNeuralDynamics/aind-ephys-ibl-alignment-gui-converter/blob/main/code/run_capsule.py

@alejoe91 alejoe91 added enhancement New feature or request exporters Related to exporters module labels May 14, 2024
@jonahpearl
Copy link
Contributor Author

Aha! Thanks for the tip — I will take a look and see if I can modify it for my use case.

@jonahpearl
Copy link
Contributor Author

Hi @alejoe91 — I'm encountering an error where there's some mismatched channel labeling. I think it's due to this line that appears to be converting the channel index into the Y value on the npx probe (ie since channel 381 has a probe position of (0, 3820), it gets labeled as "382"). Any idea why they're doing that? It's causing an issue for me where I sometimes have an odd number of total channels in my spikeinterface recording (e.g. 381, because I exclude any that are bad acc. to si.detect_bad_channels), and the last channel is labeled as n+1 in the data, and so it causes an index error further down the road when there are only n channels available. Does the IBL gui use channel numbers for depth? Surely not...I downloaded their sample data and confirmed that their clusters.channels.npy contains a mix of even / odd numbers, so however that example data was created didn't seem to have done this step. I changed this line to be cluster_channels.append(extremum_channel_index) and it seems to work fine. Let me know if you foresee any issues with that.

@alejoe91
Copy link
Member

alejoe91 commented Jun 5, 2024

Not sure honestly, but maybe @jsiegle can comment on that?

I think that your solution should be correct. The extremum channel index is already the channel that should be used.

@jsiegle
Copy link
Contributor

jsiegle commented Jun 5, 2024

I think that should work! Let us know if you encounter any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporters Related to exporters module
Projects
None yet
Development

No branches or pull requests

4 participants