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

shortened open source data cannot work in kilosort #109

Closed
xintangg opened this issue Sep 7, 2019 · 2 comments · Fixed by #595
Closed

shortened open source data cannot work in kilosort #109

xintangg opened this issue Sep 7, 2019 · 2 comments · Fixed by #595

Comments

@xintangg
Copy link

xintangg commented Sep 7, 2019

hi, I download the neural signal data from neuropixel official website (http://data.cortexlab.net/singlePhase3/data/) and it's a 385/*36000000 matrix. 385 stands for channel and 36000000 stands for timepoints. I was trying to sort these signals and it worked with the original downloaded raw data. Strange things happened when I used the processed raw data: due to the limited computing resource, I 'cut' the original matrix to a 385/*600000 matrix with matlab and then set it as the input of kilosort:

fileID=fopen('F:\neuropixel_dataexample\rawDataSample.bin','r');
rawdata=fread(fileID);
fclose(fileID);
shortdata=reshape(rawdata,[],385);
shortdata1=shortdata(1:600000,:);
shortdata1=int16(shortdata1);
shortdata1=shortdata1';
fileID1=fopen('F:\neuropixel_dataexample\shortrawDataSample.bin','w');
fwrite(fileID1,shortdata1);
fclose(fileID1);

Then the kilosort's GUI finished sorting and reported a error:"error saving data for phy reference to nonexistent field 'wphy'" and the produced rez.mat file contains no st array. (However, the unprocessed/uncut raw data works well with kilosort.

Is there anything wrong?

@marius10p
Copy link
Contributor

The raw binary file is in order chan1 time1, chan2 time1... chan385 time1, chan1 time 2 etc, which Matlab reads in Fortran order. So your reshape operation should be like this

shortdata = reshape(rawdata, 385, []);

and then you don't need the extra transpose in line

shortdata1 = shortdata1';

@marius10p
Copy link
Contributor

Closed due to lack of activity.

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.

2 participants