cortex-lab / phy

phy: interactive visualization and manual spike sorting of large-scale ephys data
BSD 3-Clause "New" or "Revised" License
311 stars 157 forks source link

Quickly filter by time in WavevormView, TemplateFeatureView, FeatureView, CorrelogramView #1127

Open lshaheen opened 2 years ago

lshaheen commented 2 years ago

Hi,

For deciding if a cluster that slowly drifts across electrodes contains spikes from the same neuron, it would be really handy if there was a quick way to filter by time in the WavevormView, TemplateFeatureView, FeatureView, and CorrelogramViews. This would let you quickly tell, for example if the autocorrelation is similar at the beginning and end of a recording, or the spike shape is similar. If they're similar, it's more evidence that it's a stable single-unit.

You can sort-of do this right now by splitting out sections of a cluster by time, but it's slow and imprecise, and you can't easily compare two clusters at an early time vs a later time for example.

I think it would be pretty easy, just apply a mask to the spikes that get selected for those views. The part I'm less sure of how to do is to add it to the GUI. The way I'm thinking of it you could add another shaded region to the AmplitudeView that indicates the time filter, and some controls to change its width and center. Maybe shift+right-click to change the center?