You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If True, any template metrics attached to the `sorting_analyzer` are deleted. If False, any metrics which were previously calculated but are not included in `metric_names` are kept, provided the `metrics_kwargs` are unchanged.
67
-
metrics_kwargs : dict
68
-
Additional arguments to pass to the metric functions. Including:
69
-
* recovery_window_ms: the window in ms after the peak to compute the recovery_slope, default: 0.7
70
-
* peak_relative_threshold: the relative threshold to detect positive and negative peaks, default: 0.2
71
-
* peak_width_ms: the width in samples to detect peaks, default: 0.2
72
-
* depth_direction: the direction to compute velocity above and below, default: "y" (see notes)
73
-
* min_channels_for_velocity: the minimum number of channels above or below to compute velocity, default: 5
74
-
* min_r2_velocity: the minimum r2 to accept the velocity fit, default: 0.7
75
-
* exp_peak_function: the function to use to compute the peak amplitude for the exp decay, default: "ptp"
76
-
* min_r2_exp_decay: the minimum r2 to accept the exp decay fit, default: 0.5
77
-
* spread_threshold: the threshold to compute the spread, default: 0.2
78
-
* spread_smooth_um: the smoothing in um to compute the spread, default: 20
79
-
* column_range: the range in um in the horizontal direction to consider channels for velocity, default: None
80
-
- If None, all channels all channels are considered
81
-
- If 0 or 1, only the "column" that includes the max channel is considered
82
-
- If > 1, only channels within range (+/-) um from the max channel horizontal position are used
66
+
If True, any template metrics attached to the `sorting_analyzer` are deleted. If False, any metrics which were previously calculated but are not included in `metric_names` are kept, provided the `metric_params` are unchanged.
67
+
metric_params : dict of dicts or None, default: None
68
+
Dictionary with parameters for template metrics calculation.
69
+
Default parameters can be obtained with: `si.postprocessing.template_metrics.get_default_tm_params()`
83
70
84
71
Returns
85
72
-------
@@ -100,15 +87,29 @@ class ComputeTemplateMetrics(AnalyzerExtension):
100
87
need_recording=False
101
88
use_nodepipeline=False
102
89
need_job_kwargs=False
90
+
need_backward_compatibility_on_load=True
103
91
104
92
min_channels_for_multi_channel_warning=10
105
93
94
+
def_handle_backward_compatibility_on_load(self):
95
+
96
+
# For backwards compatibility - this reformats metrics_kwargs as metric_params
97
+
if (metrics_kwargs:=self.params.get("metrics_kwargs")) isnotNone:
Kwargs which are passed to the method function. These can be found in the docstrings of `compute_center_of_mass`, `compute_grid_convolution` and `compute_monopolar_triangulation`.
0 commit comments