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 µ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 µm and times are in seconds. So, for example, if the templates are in units of µV then recovery_slope repolarization_slope is in µV/s.

Optionally, the following multi-channel metrics can be computed by setting: include_multi_channel_metrics=True (default if the number of channels is greater than 64):

  • “velocity_above”: the velocity in µm/ms above the max channel of the template

  • “velocity_below”: the velocity in µm/ms below the max channel of the template

  • “exp_decay”: the exponential decay in 1/µm of the template amplitude over distance

  • “spread”: the spread in µm of the template amplitudes

../../_images/1d_waveform_features.png

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()