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

Error using matlab.internal.math.interp1 and Error using gpuArray/subsref #390

Closed
kellirestivo opened this issue Apr 29, 2021 · 10 comments · Fixed by #595
Closed

Error using matlab.internal.math.interp1 and Error using gpuArray/subsref #390

kellirestivo opened this issue Apr 29, 2021 · 10 comments · Fixed by #595

Comments

@kellirestivo
Copy link

I'm using Kilosort for NeuroNexus 32 channel linear probes, and I'm getting this error during pre-processing:

Error using matlab.internal.math.interp1
Sample points must be unique and sorted in ascending order.

Error in interp1 (line 188)
VqLite = matlab.internal.math.interp1(X,V,method,method,Xqcol);

Error in shift_batch_on_disk2 (line 14)
shifts = interp1(ysamp, shifts, rez.yc, 'makima', 'extrap');

Error in datashift2 (line 149)
dprev = shift_batch_on_disk2(rez, ibatch, dshift(ibatch, :), yblk, sig, dprev);

Error in ksGUI/runPreproc (line 732)
obj.rez = datashift2(obj.rez, 1);

Error in ksGUI>@(,)obj.runPreproc() (line 333)
'Callback', @(,)obj.runPreproc());

Error while evaluating UIControl Callback.


When I work around this error, I get another error during spike sorting:

Error using gpuArray/subsref
Subscript indices must either be real positive integers or logicals.

Error in extractTemplatesfromSnippets (line 56)
wTEMP = dd(:, round(linspace(1, size(dd,2), nPCs)));

Error in extract_spikes (line 42)
[wTEMP, wPCA] = extractTemplatesfromSnippets(rez, NrankPC);

Error in ksGUI/runSpikesort (line 795)
[obj.rez, st3, tF] = extract_spikes(obj.rez);

Error in ksGUI>@(,)obj.runSpikesort() (line 339)
'Callback', @(,)obj.runSpikesort());

Error while evaluating UIControl Callback.

@marius10p
Copy link
Contributor

What are your channel map positions, ycoord and xcoord?

@kellirestivo
Copy link
Author

kellirestivo commented Jun 15, 2021 via email

@neurojaym
Copy link

I am having an identical issue!, and same mapping settings

@crewl2
Copy link

crewl2 commented Nov 15, 2021

Same issue. It would be nice to get some assistance on this problem. @marius10p

@joramvanrheede
Copy link

I'm having the same issue. What appears to be happening is that there is initially data in temp_wh.dat after preprocessDataSub; however, after running datashift2, in the function shift_batch_on_disk, temp_wh gets overwritten by all zeros.

@joramvanrheede
Copy link

I have data sets from tetrodes/hextrodes in different structures and therefore variable numbers of channels per kilosort run. Data sets with 16, 18 and 24 channels worked fine, but the issue came up in a data set with 12 channels.

@joramvanrheede
Copy link

Additionally, if I run datashift2 with do_correction set to false the sort completes successfully

@SheinIdelsonMark
Copy link

Same error. ysamp has one repeating value and is therefor not unique.

@Magontek
Copy link

Magontek commented Dec 29, 2023

Same error with a unique tetrode in a square array.
x = [0 25 0 25]
y = [0 0 25 25]
When trying to rotate in this way for the y axis to be in acendent order this way:
x = 0 21.6500000000000 -12.5000000000000 9.15000000000000
y = 0 12.5000000000000 21.6500000000000 34.1500000000000
i get a different error:

Error using matlab.internal.math.interp1
The sample points must be finite.

because the function align_block2 returns NaN

@mik-schutte
Copy link

mik-schutte commented Jan 22, 2024

Same issue data from a 16 channel linear probe NeuroNexus. Converted data to .bin file contains 16 channels

xcoords = zeros(16, 1)
ycoords =[250,350,150,550,450,50,650,750,800,700,100,500,600,200,400,300] 16x1

Value of ysamp during error generation:
in datashift2| ysamp= [2.5000 7.5000 12.5000 17.5000 22.5000]
in shift_batch_on_disk2| ysamp= = [2.5, 7.5, 7.5, 12.5, 12.5, 17.5, 17.5, 22.5, 22.5]

With this ysamp interp1 is called which causes the error.

Any help from the team would be greatly appreciated

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.

8 participants