Add option to export spike waveforms subset to phy (mimic phy extract-waveforms) - #4699
Conversation
Writes _phy_spikes_subset.{spikes,channels,waveforms}.npy from the
SortingAnalyzer's "waveforms"/"random_spikes" extensions, so phy/phy-lib
can display individual spike waveforms without re-reading the raw
recording.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
I think the new release of phy no longer supports |
This is handled in phylib and I tested with the most recent phy version: Example with I don't think we should delay this ;) |
chrishalcrow
left a comment
There was a problem hiding this comment.
Oh, there was a bug(?) in phy and no templates or waveforms were showing until I toggled and bunch of options. Ok, working for me now!
Just one request to make one of the docstrings less overly verbose.

Summary
add_waveformsoption toexport_to_phythat writes phy's_phy_spikes_subset.{spikes,channels,waveforms}.npyfiles, mimicking thephy extract-waveformsCLI command.SortingAnalyzer'swaveforms/random_spikesextensions when already computed, and computes them on demand otherwise (skipping with a warning if there's no recording available).SortingAnalyzer/sparsity combinations, matching the sparsity already used fortemplates.npy/pc_feature_ind.npy.Test plan
phylib.io.model.TemplateModel(phy's own loader) that the exported files load correctly and return proper per-cluster waveforms, for both sparse and dense analyzers.nbefore/uV scaling).src/spikeinterface/exporters/tests/coveringadd_waveforms=True.🤖 Generated with Claude Code