@@ -36,29 +36,6 @@ def count_matching_events(times1, times2, delta=10):
3636 return len (inds2 ) + 1
3737
3838
39- def count_match_spikes (times1 , all_times2 , delta_frames ): # , event_counts1, event_counts2 unit2_ids,
40- """
41- Computes matching spikes between one spike train and a list of others.
42-
43- Parameters
44- ----------
45- times1: array
46- Spike train 1 frames
47- all_times2: list of array
48- List of spike trains from sorting 2
49-
50- Returns
51- -------
52- matching_events_count: list
53- List of counts of matching events
54- """
55- matching_event_counts = np .zeros (len (all_times2 ), dtype = "int64" )
56- for i2 , times2 in enumerate (all_times2 ):
57- num_matches = count_matching_events (times1 , times2 , delta = delta_frames )
58- matching_event_counts [i2 ] = num_matches
59- return matching_event_counts
60-
61-
6239def compute_agreement_score (num_matches , num1 , num2 ):
6340 """
6441 Computes agreement score.
@@ -83,6 +60,29 @@ def compute_agreement_score(num_matches, num1, num2):
8360 return num_matches / denom
8461
8562
63+ def count_match_spikes (times1 , all_times2 , delta_frames ): # , event_counts1, event_counts2 unit2_ids,
64+ """
65+ Computes matching spikes between one spike train and a list of others.
66+
67+ Parameters
68+ ----------
69+ times1: array
70+ Spike train 1 frames
71+ all_times2: list of array
72+ List of spike trains from sorting 2
73+
74+ Returns
75+ -------
76+ matching_events_count: list
77+ List of counts of matching events
78+ """
79+ matching_event_counts = np .zeros (len (all_times2 ), dtype = "int64" )
80+ for i2 , times2 in enumerate (all_times2 ):
81+ num_matches = count_matching_events (times1 , times2 , delta = delta_frames )
82+ matching_event_counts [i2 ] = num_matches
83+ return matching_event_counts
84+
85+
8686def do_count_event (sorting ):
8787 """
8888 Count event for each units in a sorting.
0 commit comments