Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load peaks from kilosort output #3536

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

JoeZiminski
Copy link
Collaborator

@JoeZiminski JoeZiminski commented Nov 13, 2024

[In progress]
continuation from #3499

        # TODO: a couple of approaches. 1) do everything in 3D, draw a sphere around prediction, take spikes only within the sphere
        # 2) do separate for x, y. But resolution will be much lower, making things noisier, also harder to determine threshold.
        # 3) just use depth. Probably go for that. check with others.
    norm_weights = (
        pc_features / np.sum(pc_features, axis=1)[:, np.newaxis]
    )  # TOOD: discuss use of square. Probbaly do not use to keep in line with COM in SI.
    # TODO:  now max site per spike is computed from PCs, not as the channel max site as previous
    spike_max_sites = spike_features_indices[
        np.arange(spike_features_indices.shape[0]), np.argmax(norm_weights, axis=1)
    ]
    #  Zero any small channel amplitudes  TODO: removed this.
    #    threshold_values = 0.3 * template_amplitudes_unscaled  TODO: remove this to be more general. Agree?
    #    template_amplitudes_per_channel[template_amplitudes_per_channel < threshold_values[:, np.newaxis]] = 0
    # Get channel with the largest amplitude (take that as the waveform)
    template_max_site = np.argmax(
        np.max(np.abs(unwhite_templates), axis=1), axis=1
    )  # TODO: i changed this to use unwhitened templates instead of templates. This okay?
    # Use template channel with max signal as waveform
   waveforms = np.empty(
       unwhite_templates.shape[:2]
   )  # TODO: i changed this to use unwhitened templates instead of templates. This okay?
   ```

@JoeZiminski JoeZiminski force-pushed the load_peaks_from_kilosort_output branch from fd3914e to 84b9a17 Compare November 13, 2024 20:52
@JoeZiminski JoeZiminski force-pushed the load_peaks_from_kilosort_output branch from dbcf818 to 6d569a2 Compare November 14, 2024 14:23
@JoeZiminski JoeZiminski force-pushed the load_peaks_from_kilosort_output branch 2 times, most recently from 3fa3460 to 536c267 Compare November 14, 2024 19:00
@JoeZiminski JoeZiminski force-pushed the load_peaks_from_kilosort_output branch from 536c267 to f33f80c Compare November 14, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant