@@ -50,34 +50,34 @@ def bombcell_get_default_thresholds() -> dict:
5050 """
5151 bombcell - Returns default thresholds for unit labeling.
5252
53- Each metric has 'min ' and 'max ' values. Use None to disable a threshold (e.g. to ignore a metric completely
54- or to only have a min or a max threshold)
53+ Each metric has 'greater ' and 'less ' values. Use None to disable a threshold (e.g. to ignore a metric completely
54+ or to only have a greater or a less threshold)
5555 """
5656 # bombcell
5757 return {
5858 "noise" : { # failures -> NOISE
59- "num_positive_peaks" : {"min " : None , "max " : 2 },
60- "num_negative_peaks" : {"min " : None , "max " : 1 },
61- "peak_to_trough_duration" : {"min " : 0.0001 , "max " : 0.00115 }, # seconds
62- "waveform_baseline_flatness" : {"min " : None , "max " : 0.5 },
63- "peak_after_to_trough_ratio" : {"min " : None , "max " : 0.8 },
64- "exp_decay" : {"min " : 0.01 , "max " : 0.1 },
59+ "num_positive_peaks" : {"greater " : None , "less " : 2 },
60+ "num_negative_peaks" : {"greater " : None , "less " : 1 },
61+ "peak_to_trough_duration" : {"greater " : 0.0001 , "less " : 0.00115 }, # seconds
62+ "waveform_baseline_flatness" : {"greater " : None , "less " : 0.5 },
63+ "peak_after_to_trough_ratio" : {"greater " : None , "less " : 0.8 },
64+ "exp_decay" : {"greater " : 0.01 , "less " : 0.1 },
6565 },
6666 "mua" : { # failures -> MUA, only applied to units that passed noise thresholds
67- "amplitude_median" : {"min " : 30 , "max " : None , "abs" : True }, # uV
68- "snr" : {"min " : 5 , "max " : None },
69- "amplitude_cutoff" : {"min " : None , "max " : 0.2 },
70- "num_spikes" : {"min " : 300 , "max " : None },
71- "rp_contamination" : {"min " : None , "max " : 0.1 },
72- "presence_ratio" : {"min " : 0.7 , "max " : None },
73- "drift_ptp" : {"min " : None , "max " : 100 }, # um
67+ "amplitude_median" : {"greater " : 30 , "less " : None , "abs" : True }, # uV
68+ "snr" : {"greater " : 5 , "less " : None },
69+ "amplitude_cutoff" : {"greater " : None , "less " : 0.2 },
70+ "num_spikes" : {"greater " : 300 , "less " : None },
71+ "rp_contamination" : {"greater " : None , "less " : 0.1 },
72+ "presence_ratio" : {"greater " : 0.7 , "less " : None },
73+ "drift_ptp" : {"greater " : None , "less " : 100 }, # um
7474 },
7575 "non-somatic" : {
76- "peak_before_to_trough_ratio" : {"min " : None , "max " : 3 },
77- "peak_before_width" : {"min " : 0.00015 , "max " : None }, # seconds
78- "trough_width" : {"min " : 0.0002 , "max " : None }, # seconds
79- "peak_before_to_peak_after_ratio" : {"min " : None , "max " : 3 },
80- "main_peak_to_trough_ratio" : {"min " : None , "max " : 0.8 },
76+ "peak_before_to_trough_ratio" : {"greater " : None , "less " : 3 },
77+ "peak_before_width" : {"greater " : 0.00015 , "less " : None }, # seconds
78+ "trough_width" : {"greater " : 0.0002 , "less " : None }, # seconds
79+ "peak_before_to_peak_after_ratio" : {"greater " : None , "less " : 3 },
80+ "main_peak_to_trough_ratio" : {"greater " : None , "less " : 0.8 },
8181 },
8282 }
8383
@@ -123,7 +123,7 @@ def bombcell_label_units(
123123 If provided, metrics are extracted automatically using get_metrics_extension_data().
124124 thresholds : dict | str | Path | None
125125 Threshold dict or JSON file, including a three sections ("noise", "mua", "non-somatic") of
126- {"metric": {"min ": val, "max ": val}}.
126+ {"metric": {"greater ": val, "less ": val}}.
127127 If None, default Bombcell thresholds are used.
128128 label_non_somatic : bool, default: True
129129 If True, detect non-somatic (dendritic, axonal) units.
@@ -336,8 +336,8 @@ def save_bombcell_results(
336336 continue
337337 value = metrics .loc [unit_id , metric_name ]
338338 thresh = flat_thresholds [metric_name ]
339- thresh_min = thresh .get ("min " , None )
340- thresh_max = thresh .get ("max " , None )
339+ thresh_min = thresh .get ("greater " , None )
340+ thresh_max = thresh .get ("less " , None )
341341
342342 # Determine pass/fail
343343 passed = True
0 commit comments