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

Minimum requirements and interp1 #269

Closed
bruno-f-cruz opened this issue Nov 7, 2020 · 4 comments · Fixed by #595
Closed

Minimum requirements and interp1 #269

bruno-f-cruz opened this issue Nov 7, 2020 · 4 comments · Fixed by #595

Comments

@bruno-f-cruz
Copy link

Hello,

Kilo2.5 is crashing when calling
Error in shift_batch_on_disk2 (line 14) shifts = interp1(ysamp, shifts, rez.yc, 'makima', 'extrap');

I think this is because the matlab version i am using is the 2017a where the "makima" interpolation method does not exist.
reading from the doc:
The available methods are:

  'linear'   - (default) linear interpolation
  'nearest'  - nearest neighbor interpolation
  'next'     - next neighbor interpolation
  'previous' - previous neighbor interpolation
  'spline'   - piecewise cubic spline interpolation (SPLINE)
  'pchip'    - shape-preserving piecewise cubic interpolation
  'cubic'    - same as 'pchip'
  'v5cubic'  - the cubic interpolation from MATLAB 5, which does not
               extrapolate and uses 'spline' if X is not equally
               spaced.~

Can you confirm if indeed the requirements for kilosort were updated and/or this interp method can be replaced by an existing method in the version i am using?

Thanks for the help and the awesome job writting kilosort :)

B

@agbondy
Copy link
Contributor

agbondy commented Nov 9, 2020

I noticed this too. The requirements should be updated to >=R2017b. The "makima" interpolation option is only available in that version and more recent.

@AlexSonneborn
Copy link

I also have this error using 2020a. The full error I get is:

Looking for data inside E:\Ephys\MouseID\SOM-13(2)\SOM-13-2(4) - Copy 
Time   0s. Computing whitening matrix.. 
Getting channel whitening matrix... 
Channel-whitening matrix computed. 
Time   0s. Loading raw data and applying filters... 
Time  16s. Finished preprocessing 275 batches. 
pitch is 1 um
0.02 sec, 1 batches, 81 spikes 
4.15 sec, 101 batches, 14416 spikes 
6.94 sec, 201 batches, 22504 spikes 
9.08 sec, 275 batches, 26502 spikes 
Error using matlab.internal.math.interp1
Sample points must be unique and sorted in ascending order.

Error in interp1 (line 154)
        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 136)
        dprev = shift_batch_on_disk2(rez, ibatch, dshift(ibatch, :), yblk, sig, dprev);

Error in main_kilosort (line 42)
rez = datashift2(rez, 1); % last input is for shifting data

Have you made any progress figuring this out? I have changed all my electrode geometry parameters and still no luck.

@agbondy
Copy link
Contributor

agbondy commented Nov 10, 2020

@AlexSonneborn I would suggest you move this to another issue and describe your situation more thoroughly. Your error is unrelated to the one described in this issue, although it does occur at the same line. The issue we were discussing is an error related to the unrecognized "makima" interpolation algorithm in older matlab versions.

@marius10p
Copy link
Contributor

Makima has a particularly good extrapolation behavior for channels on the end of the probes, but it's possible another one of those works as well, I'll have to try.

@AlexSonneborn I need more information, like what kind of probe and how the channels are arranged. Looks like relatively few channels, so I recommend settings ops.nblocks = 1, which might prevent this error altogether.

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.

4 participants