Skip to content

BUG: cluster_templates function returns vastly different waveforms from the one in `templates.npy #894

@teristam

Description

@teristam

Describe the issue:

Hi,

I try to get the template waveform of a cluster both from the new cluster_templates function and the original templates.npy. I notice the waveform returned by both are vastly different from each others:

Image

I understand that the results from cluster_templates are scaled according to the spike amplitude, but even the best channel calculated within the cluster_templates() is different from the results from get_best_channels()

Upon looking closer, I notice that in

spike_idx = spike_clusters[spike_clusters == cluster_id]
temps = get_templates(spike_idx, results_dir)

The spike_idx refers to a list of cluster id, but in

template_idx = spike_templates[spike_idx]

spike_idx actually refers to the index of detected spikes.

Is there a potential issue there?

Reproduce the bug:

Error message:

Version information:

4.0.27

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions