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

How to save waveforms from spikeinterface to NWB? #3615

Open
khl02007 opened this issue Jan 13, 2025 · 2 comments
Open

How to save waveforms from spikeinterface to NWB? #3615

khl02007 opened this issue Jan 13, 2025 · 2 comments
Labels
question General question regarding SI

Comments

@khl02007
Copy link
Contributor

Is there a function to save waveforms in spikeinterface (SortingAnalyzer extension or older WaveformExtractor) to NWB format?

@alejoe91 alejoe91 added the question General question regarding SI label Jan 14, 2025
@alejoe91
Copy link
Member

Hi @khl02007!

You can use the write_sorting_analyzer from the neuroconv package!

from neuroconv.tools.spikeinterface.spikeinterface import write_sorting_analyzer

write_sorting_analyzer(sorting_analyzer, nwbfile_path="path-to-nwb-file")

You can also write to an open nwbfile using the nwbfile argument or simply add the sorting analyzer info (units table + waveform means/stds + quality/template metrics column) to an open nwbfile without writing it with the add_sorting_analyzer_to_nwbfile function.

@h-mayorquin
Copy link
Collaborator

Clarification for people that were confused like me: Note that this adds the means and the stds of the waveforms for each units as @alejoe91 mentions above. It does not add all the waveforms which is probably a good idea since that will make the NWB explode in size and anyway you can quickly extract each of the individual waveforms on the fly as you have the timings on the units table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General question regarding SI
Projects
None yet
Development

No branches or pull requests

3 participants