SpikeInterface / SpikeInterface/spikeinterface
Aligning waveforms across spike clusters/templates
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 847
- Forks
- 280
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 29
Description
Dear Developers,
I would like to make a suggestion / report an issue regarding the alignment of waveforms in SortingAnalyzer.
When creating a SortingAnalyzer directly, I noticed that the waveform negative peaks are not automatically aligned temporally across spikes/templates. (Please see attached Figure and codes: the minimum points differ between 38 and 39).
I tried correcting this using get_template_extremum_channel_peak_shift() together with align_sorting(), but applying the returned shifts directly moves spikes further in the wrong direction. What worked for me as an ad hoc solution was manually reversing the sign of the shifts before calling align_sorting(). (Corrected figure and codes attached.)
(The difference is more apparent when you scroll through the two waveform images back and forth, but it is also shown in the numbers.)
It might be worth considering whether this alignment step (or any consistent peak-centering of templates) could be integrated directly into the SortingAnalyzer pipeline, so users do not need to compute peak shifts and apply align_sorting() manually as a separate preprocessing step.
If there are any existing solutions that I haven't considered, please let me know!
Thanks so much!
Domokos
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SortingAnalyzer and trace how get_template_extremum_channel_peak_shift() interacts with align_sorting(). Reproduce the reported waveform peak positions, then determine the expected shift direction and whether alignment belongs in the SortingAnalyzer pipeline; done means the behavior is consistent and covered by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100