Template Metrics
This extension computes commonly used waveform/template metrics. By default, the following metrics are computed:
“peak_to_valley”: duration in \(s\) between negative and positive peaks
“halfwidth”: duration in \(s\) at 50% of the amplitude
“peak_to_trough_ratio”: ratio between negative and positive peaks
“recovery_slope”: speed to recover from the negative peak to 0
“repolarization_slope”: speed to repolarize from the positive peak to 0
“num_positive_peaks”: the number of positive peaks
“num_negative_peaks”: the number of negative peaks
The units of recovery_slope and repolarization_slope depend on the
input. Voltages are based on the units of the template. By default this is \(\mu V\)
but can be the raw output from the recording device (this depends on the
return_in_uV parameter, read more here: SortingAnalyzer).
Distances are in \(\mu m\) and times are in seconds. So, for example, if the
templates are in units of \(\mu V\) then: repolarization_slope is in
\(mV / s\); peak_to_trough_ratio is in \(\mu m\) and the
halfwidth is in \(s\).
Optionally, the following multi-channel metrics can be computed by setting:
include_multi_channel_metrics=True
“velocity_above”: the velocity in \(\mu m/s\) above the max channel of the template
“velocity_below”: the velocity in \(\mu m/s\) below the max channel of the template
“exp_decay”: the exponential decay in \(\mu m\) of the template amplitude over distance
“spread”: the spread in \(\mu m\) of the template amplitude over distance
Visualization of template metrics. Image from ecephys_spike_sorting from the Allen Institute.
tm = sorting_analyzer.compute(input="template_metrics", include_multi_channel_metrics=True)
For more information, see compute_template_metrics()