Skip to content

Commit

Permalink
Merge pull request #2997 from Djoels/main
Browse files Browse the repository at this point in the history
whiteningRange added as Kilosort 2.5 parameter
  • Loading branch information
alejoe91 authored Jun 21, 2024
2 parents 5f854d4 + b2b9001 commit 8cf0346
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/spikeinterface/sorters/external/kilosort2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Kilosort2Sorter(KilosortBase, BaseSorter):
"detect_threshold": 6,
"projection_threshold": [10, 4],
"preclust_threshold": 8,
"whiteningRange": 32, # samples of the template to use for whitening "spatial" dimension
"momentum": [20.0, 400.0],
"car": True,
"minFR": 0.1,
Expand All @@ -62,6 +63,7 @@ class Kilosort2Sorter(KilosortBase, BaseSorter):
"detect_threshold": "Threshold for spike detection",
"projection_threshold": "Threshold on projections",
"preclust_threshold": "Threshold crossings for pre-clustering (in PCA projection space)",
"whiteningRange": "Number of channels to use for whitening each channel",
"momentum": "Number of samples to average over (annealed from first to second value)",
"car": "Enable or disable common reference",
"minFR": "Minimum spike rate (Hz), if a cluster falls below this for too long it gets removed",
Expand Down Expand Up @@ -199,7 +201,7 @@ def _get_specific_options(cls, ops, params):
ops["NT"] = params[
"NT"
] # must be multiple of 32 + ntbuff. This is the batch size (try decreasing if out of memory).
ops["whiteningRange"] = 32.0 # number of channels to use for whitening each channel
ops["whiteningRange"] = params["whiteningRange"] # number of channels to use for whitening each channel
ops["nSkipCov"] = 25.0 # compute whitening matrix from every N-th batch
ops["nPCs"] = params["nPCs"] # how many PCs to project the spikes into
ops["useRAM"] = 0.0 # not yet available
Expand Down
4 changes: 3 additions & 1 deletion src/spikeinterface/sorters/external/kilosort2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Kilosort2_5Sorter(KilosortBase, BaseSorter):
"detect_threshold": 6,
"projection_threshold": [10, 4],
"preclust_threshold": 8,
"whiteningRange": 32.0,
"momentum": [20.0, 400.0],
"car": True,
"minFR": 0.1,
Expand Down Expand Up @@ -69,6 +70,7 @@ class Kilosort2_5Sorter(KilosortBase, BaseSorter):
"detect_threshold": "Threshold for spike detection",
"projection_threshold": "Threshold on projections",
"preclust_threshold": "Threshold crossings for pre-clustering (in PCA projection space)",
"whiteningRange": "Number of channels to use for whitening each channel",
"momentum": "Number of samples to average over (annealed from first to second value)",
"car": "Enable or disable common reference",
"minFR": "Minimum spike rate (Hz), if a cluster falls below this for too long it gets removed",
Expand Down Expand Up @@ -220,7 +222,7 @@ def _get_specific_options(cls, ops, params):
ops["NT"] = params[
"NT"
] # must be multiple of 32 + ntbuff. This is the batch size (try decreasing if out of memory).
ops["whiteningRange"] = 32.0 # number of channels to use for whitening each channel
ops["whiteningRange"] = params["whiteningRange"] # number of channels to use for whitening each channel
ops["nSkipCov"] = 25.0 # compute whitening matrix from every N-th batch
ops["nPCs"] = params["nPCs"] # how many PCs to project the spikes into
ops["useRAM"] = 0.0 # not yet available
Expand Down
4 changes: 3 additions & 1 deletion src/spikeinterface/sorters/external/kilosort3.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Kilosort3Sorter(KilosortBase, BaseSorter):
"detect_threshold": 6,
"projection_threshold": [9, 9],
"preclust_threshold": 8,
"whiteningRange": 32,
"car": True,
"minFR": 0.2,
"minfr_goodchannels": 0.2,
Expand Down Expand Up @@ -65,6 +66,7 @@ class Kilosort3Sorter(KilosortBase, BaseSorter):
"detect_threshold": "Threshold for spike detection",
"projection_threshold": "Threshold on projections",
"preclust_threshold": "Threshold crossings for pre-clustering (in PCA projection space)",
"whiteningRange": "number of channels to use for whitening each channel",
"car": "Enable or disable common reference",
"minFR": "Minimum spike rate (Hz), if a cluster falls below this for too long it gets removed",
"minfr_goodchannels": "Minimum firing rate on a 'good' channel",
Expand Down Expand Up @@ -212,7 +214,7 @@ def _get_specific_options(cls, ops, params):
ops["NT"] = params[
"NT"
] # must be multiple of 32 + ntbuff. This is the batch size (try decreasing if out of memory).
ops["whiteningRange"] = 32.0 # number of channels to use for whitening each channel
ops["whiteningRange"] = params["whiteningRange"] # number of channels to use for whitening each channel
ops["nSkipCov"] = 25.0 # compute whitening matrix from every N-th batch
ops["scaleproc"] = 200.0 # int16 scaling of whitened data
ops["nPCs"] = params["nPCs"] # how many PCs to project the spikes into
Expand Down

0 comments on commit 8cf0346

Please sign in to comment.