whitening_mat.npy problem
In kilosort 2.0, the whitening_mat.npy file contains the real whitening matrix: whiteningMatrix = rez.Wrot/rez.ops.scaleproc; The inverse of this matrix is used to compute the template amplitude using this code whiteningMatrixInv = whiteningMatrix^-1;
% here we compute the amplitude of every template...
% unwhiten all the templates
tempsUnW = zeros(size(templates));
for t = 1:size(templates,1)
tempsUnW(t,:,:) = squeeze(templates(t,:,:))*whiteningMatrixInv;
end
% The amplitude on each channel is the positive peak minus the negative
tempChanAmps = squeeze(max(tempsUnW,[],2))-squeeze(min(tempsUnW,[],2));
By contrast, in kilosort 2.5 and kilosort 3.0, the whitening_mat.npy only contains a diagonal matrix that not correspond with the real whitening matrix used in the code: whiteningMatrix = eye(size(rez.Wrot)) / rez.ops.scaleproc;
Which one is the reason to introduce this change in the code?.
I don't think this is right, could you please send the line numbers?
@marius10p
I have a same issue.
After kilosort 2.5 and 3.0 (not 2.0), the whitening_mat.npy contains diagonal matrix. For that reason, I cannot get template amplitude.

Are there any changes in calculating a template amplitude at kilosort 2.5 and 3.0?
I don't think this is right, could you please send the line numbers?
I think it was last updated here in rezToPhy and inherited by rezToPhy2, so "whitening_mat.npy" and "whitening_mat_inv.npy" do not contain the real matrices. Is there much significance to this change @marius10p ? https://github.com/MouseLand/Kilosort/blob/ad462bd78010f1f872fffefa2cfe31e649361da2/utils/rezToPhy.m#L69-L71
might this discussion be related to this issue?