Skip to content

Export_to_ibl (take 2)#3857

Merged
alejoe91 merged 15 commits into
SpikeInterface:mainfrom
jonahpearl:ibl_exporter_2
Apr 23, 2025
Merged

Export_to_ibl (take 2)#3857
alejoe91 merged 15 commits into
SpikeInterface:mainfrom
jonahpearl:ibl_exporter_2

Conversation

@jonahpearl
Copy link
Copy Markdown
Contributor

Attempts to resolve #2843, again :) This version doesn't require any utility functions outside of what spikeinterface already has, plus some functionality from numpy and scipy.

I expect that someone who knows SI a bit better than me will be able to take the _get_rms function and convert it into a class that can use the ChunkExtractor to speed things up with multi-processing. If no one gets around to it by the next month I can have a go, I just have some deadlines in the meantime. The LFP spectrum is currently just calculated on a single snippet of LFP data, so I don't think it needs to be parallelized.

@jonahpearl jonahpearl changed the title ake 2 on export_to_ibl Export_to_ibl (take 2) Apr 10, 2025
Copy link
Copy Markdown
Member

@zm711 zm711 left a comment

Choose a reason for hiding this comment

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

I think this is cool. I think Alessio would have to take the rms function to deal with the chunking. But keeping things within the si framework is super nice. a couple initial comments that should be super easy to do.

Comment thread src/spikeinterface/exporters/to_ibl.py Outdated
Comment thread src/spikeinterface/exporters/to_ibl.py Outdated
Comment thread src/spikeinterface/exporters/to_ibl.py Outdated
Comment thread src/spikeinterface/exporters/to_ibl.py Outdated
@alejoe91 alejoe91 self-assigned this Apr 11, 2025
@alejoe91
Copy link
Copy Markdown
Member

Will do! Thanks for the re-writing @jonahpearl !!

@jonahpearl jonahpearl mentioned this pull request Apr 11, 2025
@alejoe91 alejoe91 added the exporters Related to exporters module label Apr 11, 2025
@jonahpearl
Copy link
Copy Markdown
Contributor Author

-- Added a test (passes locally for me), made a few fixes based on that
-- Loosened the IBL unit standards a bit, since it's presumably ok to have some mua here. Could allow users to pass their own criteria?
-- Fixed skip_pc_metrics to be True (which was my original intention, just got the sign of the parameter flipped in my head). This should speed things up for large recordings, and if anyone really wants the PC metrics they can use the export to phy feature with those on.
-- Slightly simplified the bit that checks the pre-computed qm's.

Copy link
Copy Markdown
Member

@zm711 zm711 left a comment

Choose a reason for hiding this comment

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

Hey Jonah few more things on my end. I don't want to generate too much work before Alessio hops onto this PR. But I think we definitely need to protect for the case where the user no longer has a useable recording.

Comment thread src/spikeinterface/exporters/to_ibl.py Outdated
Comment thread src/spikeinterface/exporters/to_ibl.py Outdated
Comment thread src/spikeinterface/exporters/to_ibl.py Outdated
Comment thread src/spikeinterface/exporters/to_ibl.py Outdated
Comment thread src/spikeinterface/exporters/to_ibl.py Outdated
@zm711
Copy link
Copy Markdown
Member

zm711 commented Apr 14, 2025

Thanks Jonah. I'll leave this alone now until Alessio deals with it just to ensure we don't end up with conflicting stuff! :)

@alejoe91
Copy link
Copy Markdown
Member

alejoe91 commented Apr 23, 2025

Hi @jonahpearl

I finally found some time to review and work on this.

Here are some updates:

  • I added parallelization to the compute rms function
  • improved chunk retrieval for psd estimation
  • remove export to phy and file mapping (I realized we have everything we need in the analyzer!)
  • removed auto-computation of extensions and QC
  • made the definition of good units more flexible, with a good_unit_query that acts on the qm dataframe
  • extended tests
  • renamed the function: export_to_ibl_gui (IMO, export to IBL is too vague)

Can you test it on your side and make sure that the IBL GUI works well with the output?

@jonahpearl
Copy link
Copy Markdown
Contributor Author

Just tried it out — works well and fast. Seems like there's one test failing just because it still has the old function name.

@alejoe91
Copy link
Copy Markdown
Member

Just tried it out — works well and fast. Seems like there's one test failing just because it still has the old function name.

Fixed now!

@alejoe91
Copy link
Copy Markdown
Member

Awesome! I'll merge then :)

@alejoe91 alejoe91 merged commit 6f2cd36 into SpikeInterface:main Apr 23, 2025
15 checks passed
@jonahpearl
Copy link
Copy Markdown
Contributor Author

Thanks Alessio!

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

Labels

exporters Related to exporters module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] Export to IBL Atlas tool?

3 participants