You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The waveform templates are nt0 samples long (which defaults to 61), with the trough of the waveform occurring at ops.nt0min which defaults to 20. When exporting to Phy, the Kilosort2 code pre-pads the templates with nt0min+1 zeros at splitAllClusters.m L192 at
where rezToPhy uses rez.Wphy to construct the templates. So this gets you 1 + 20 + 61 = 82 samples, which puts the trough at 1 + 20 + 20 = 41 samples into the waveform, which is centered within the template. This is where Phy expects to line up the template against the list of spike times.
I suspect the problem is that while this works for the default values, the correct amount of padding to achieve centering would be nt0 - 2*nt0min - 1, i.e.
I haven't tested this yet with a different nt0min value, will try and see what happens.
Changing ops.nt0min or ops.nt0 also would affect plotting in the GUI, as currently the offset of -19 is hardcoded in predictData.m L34
theseSamps = st(s)+(1:buff)-19-samps(1)+buff*2;
This might also be tangentially related to #63, although there the templates don't just look offset. I wonder if there's a conceptually similar issue where the templates are fit to data using the original hardcoded nt0min of 20 and the waveforms are extracted using the actual nt0min value? Seems unlikely.
The text was updated successfully, but these errors were encountered:
The waveform templates are
nt0
samples long (which defaults to 61), with the trough of the waveform occurring atops.nt0min
which defaults to 20. When exporting to Phy, the Kilosort2 code pre-pads the templates withnt0min+1
zeros at splitAllClusters.m L192 atwhere rezToPhy uses rez.Wphy to construct the templates. So this gets you 1 + 20 + 61 = 82 samples, which puts the trough at 1 + 20 + 20 = 41 samples into the waveform, which is centered within the template. This is where Phy expects to line up the template against the list of spike times.
I suspect the problem is that while this works for the default values, the correct amount of padding to achieve centering would be
nt0 - 2*nt0min - 1
, i.e.If this is correct, maybe changing splitAllClusters.m L192 to this instead would ensure the samples stay centered?
I haven't tested this yet with a different nt0min value, will try and see what happens.
Changing
ops.nt0min
orops.nt0
also would affect plotting in the GUI, as currently the offset of -19 is hardcoded in predictData.m L34This might also be tangentially related to #63, although there the templates don't just look offset. I wonder if there's a conceptually similar issue where the templates are fit to data using the original hardcoded
nt0min
of 20 and the waveforms are extracted using the actualnt0min
value? Seems unlikely.The text was updated successfully, but these errors were encountered: