Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgarcia committed Oct 6, 2023
1 parent 3b681bf commit f465e81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/spikeinterface/sorters/internal/tridesclous2.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ def _run_from_folder(cls, sorter_output_folder, params, verbose):

original_labels = peaks["channel_index"]

min_cluster_size = 50

post_split_label, split_count = split_clusters(
original_labels,
recording,
Expand All @@ -208,8 +210,8 @@ def _run_from_folder(cls, sorter_output_folder, params, verbose):
# feature_name="sparse_wfs",
neighbours_mask=neighbours_mask,
waveforms_sparse_mask=sparse_mask,
min_size_split=50,
min_cluster_size=50,
min_size_split=min_cluster_size,
min_cluster_size=min_cluster_size,
min_samples=50,
n_pca_features=3,
),
Expand Down Expand Up @@ -240,9 +242,10 @@ def _run_from_folder(cls, sorter_output_folder, params, verbose):
# criteria="percentile",
# threshold_percentile=80.,
criteria="distrib_overlap",
threshold_overlap=0.4,
threshold_overlap=0.3,
min_cluster_size=min_cluster_size+1,
# num_shift=0
num_shift=2,
num_shift=5,
),
**job_kwargs,
)
Expand Down
7 changes: 5 additions & 2 deletions src/spikeinterface/sortingcomponents/clustering/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ def merge(
threshold_diptest=0.5,
threshold_percentile=80.0,
threshold_overlap=0.4,
min_cluster_size=50,
num_shift=2,
):
if num_shift > 0:
Expand All @@ -414,7 +415,7 @@ def merge(
chans1 = np.unique(peaks["channel_index"][inds1])
target_chans1 = np.flatnonzero(np.all(waveforms_sparse_mask[chans1, :], axis=0))

if inds0.size < 40 or inds1.size < 40:
if inds0.size < min_cluster_size or inds1.size < min_cluster_size:
is_merge = False
merge_value = 0
final_shift = 0
Expand Down Expand Up @@ -525,7 +526,9 @@ def merge(
# DEBUG = True
DEBUG = False

if DEBUG and is_merge:
# if DEBUG and is_merge:
# if DEBUG and (overlap > 0.1 and overlap <0.3):
if DEBUG:
# if DEBUG and not is_merge:
# if DEBUG and (overlap > 0.05 and overlap <0.25):
# if label0 == 49 and label1== 65:
Expand Down

0 comments on commit f465e81

Please sign in to comment.