features.spikes
features.spikes(
data,
fs,
geometry,
return_waveforms=True,
backend='dartsort',
scratch_dir=None,
**params,
)Spike detection and feature extraction with multiple backend support.
This function performs spike detection and feature extraction using either Dartsort or SpikeInterface backend, with comprehensive feature computation including waveform analysis and spike characterization.
Args: data (np.ndarray): Raw electrophysiology data with shape [nc, ns] where nc is number of channels and ns is number of samples. fs (int): Sampling frequency in Hz. geometry (dict): Channel geometry dictionary with ‘x’ and ‘y’ arrays. return_waveforms (bool, optional): Whether to return waveforms dictionary. Defaults to True. backend (str, optional): Backend to use (‘dartsort’ or ‘spikeinterface’). Defaults to ‘dartsort’. scratch_dir (str, optional): Directory for temporary files. **params: Backend-specific parameters.
Returns: pd.DataFrame or tuple: If return_waveforms is False, returns DataFrame with aggregated waveform features per channel. If True, returns tuple of (DataFrame, waveforms_dict).
Raises: ValueError: If an unknown backend is specified.
Note: The function aggregates waveform features by channel and computes various waveform characteristics including timing, amplitude, and slope features. Both backends produce compatible output formats for further processing.