csn-le / wave_clus

A fast and unsupervised algorithm for spike detection and sorting using wavelets and super-paramagnetic clustering
127 stars 66 forks source link

Error in run_cluster.m, cluster_64.exe #112

Closed aboharbf closed 5 years ago

aboharbf commented 5 years ago

Digging through, trying to change path related loading and saving, arrived at the function which calls cluster_64.exe and got the following:

error:
at line 339 of 'io.c': parameter file error

Paths being fed in seem appropriate - the first being the full path to "cluster_64.exe", the latter being the full path to "data_wc1.run", which contains all the variables printed into in the beginning of run_cluster.m

NumberOfPoints: 40000
DataFile: D:\Path\tmp_data_wc1
OutFile: D:\Path\data_wc1
Dimensions: 14
MinTemp: 0
MaxTemp: 0.251
TempStep: 0.01
SWCycles: 100
KNearestNeighbours: 11
MSTree|
DirectedGrowth|
SaveSuscept|
WriteLables|
WriteCorFile~
aboharbf commented 5 years ago

Additional Finding: the path for DataFile and OutFile both had a folder with a space in the name. after downloading a new copy of wave_clus and seeing it work on the files in the current directory, and noticing the space may be tripping up some code in the clustering .exe, I changed the space for an underscore and got this:

error:
at line 81 of 'param.c': too long
ferchaure commented 5 years ago

That is quite odd but we don't have access to the SPC source code. Did you try with a shorter path?

ferchaure commented 5 years ago

Maybe a possible solution is copy the .exe file in the data folder and then use the relative path. See the commented lines in wave_clus/Batch_files/run_cluster.m

aboharbf commented 5 years ago

So your original suggestion worked out. What I ended up doing was the following:

Added this block of code at the beginning:

%temporary path shorting (SPC seems to have issue w/ longer paths)
origfname = fname;
origfname_in = fname_in;
[~, fname_in, ~] = fileparts(fname_in);
[tmpDir, fname, ~] = fileparts(fname);
oldDir = cd(tmpDir);

and this at the end

cd(oldDir);

I think I've finally made it to the end of the script w/ the new directory thing. Thanks for the help.

ferchaure commented 5 years ago

That is a better solution, I will add something like that in the future