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

should handle case of no isolated spikes found in a batch #566

Closed
magland opened this issue Oct 5, 2023 · 0 comments · Fixed by #595
Closed

should handle case of no isolated spikes found in a batch #566

magland opened this issue Oct 5, 2023 · 0 comments · Fixed by #595

Comments

@magland
Copy link

magland commented Oct 5, 2023

This is related to the following issues #525 #335

It seems that kilosort3 crashes if no isolated spikes are found in a batch during datashift2.m

Sometimes a dataset simply contains no spikes, in which case I would expect kilosort to return an empty sorting rather than to crash. This can happen, for example, when sorting a subset of channels that do not have signal.

This crash also occurs if there are no spikes within a sub-time-window of the recording corresponding to a kilosort batch. This can happen when there is a dead zone for part of the dataset, for whatever reason.

The error occurs at this line because size(dd,2) is zero:

wTEMP = dd(:, round(linspace(1, size(dd,2), nPCs)));

The error message is Subscript indices must either be real positive integers or logicals.

LMK if you want me to work on a PR to gracefully handle this case.

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 a pull request may close this issue.

1 participant