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
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