Skip to content

Commit

Permalink
fixed bug with center-finding for single-shank
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobpennington committed Apr 13, 2024
1 parent d80331b commit 9623798
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kilosort/clustering_qr.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ def x_centers(ops):
# peaks are indices, translate back to position in microns
approx_centers = [edges[p] for p in peaks]
# Use these as initial guesses for centroids in k-means to get
# a more accurate value for the actual centers.
# a more accurate value for the actual centers. Or, if there's only 1,
# just look for one centroid.
if len(approx_centers) == 1: approx_centers = 1
centers, distortion = kmeans(ops['xc'], approx_centers)

# TODO: Maybe use distortion to raise warning if it seems too large?
Expand Down

0 comments on commit 9623798

Please sign in to comment.