MouseLand / Kilosort

Fast spike sorting with drift correction for up to a thousand channels
https://kilosort.readthedocs.io/en/latest/
GNU General Public License v3.0
455 stars 238 forks source link

Error preprocessing due to probe map parameters? #192

Closed hana777 closed 4 years ago

hana777 commented 4 years ago

Hi everybody,

After converting my data into a proper binary file, I managed to succesfully load the data in the launcher. However, upon selecting a new probe layout, I try to run preprocessing. This yields the following error:

Error preprocessing! Unable to perform assignment because the left and right sides have a different number of elements.

The probe I'm using is an H2 from NeuroTech: 2x32 channels, seperated 250 um. Does anybody have tips on how to insert the correct information for a new probe, using the GUI? Thanks in advance.

marius10p commented 4 years ago

Have you tried to follow the wiki?

hana777 commented 4 years ago

Yes. However, the probe I am using has 2 shanks, each with 32 channels. This is different from the example in the wiki and therefore I wonder whether the probe parameters I have filled in might somehow be incorrect and therefore cause a problem in preprocessing and spikesorting. [I have also tried to run a spikesorting session using artificial data generated with the eMouse simulator. These data seem to be sorted well. Therefore I suspect that the problem lies with the probe map parameters. The artificial data simulated a recording with the Neuropixels Phase3A probe, which is not the probe I use in my own recordings.]

The output file containing the voltage data of my recording has 64 rows. The odd-numbered rows belong to shank 1, the even-numbered rows correspond to the channels on shank 2. The two shanks are approximately 800 um long and located 250 um apart.

These are the parameters I have filled in for the probe in the GUI: xcoordinates: [ones(32,1); 250*ones(32,1)] (32 channels with x=1, 32 channels with x=250)

ycoordinates: [1:(800/32):800, (1:(800/32):800)] (channels 1-32 have ycoordinates linearly spaced between 1-800, the same is true for channels 33-64)

shank index: [ones(32,1); 2ones(32,1)] (the first 32 elements in the xcoord and ycoord arrays are located on shank 1, the others on shank 2) _[I also attempted a 0-based shank index: instead of [ones(32,1); 2 ones(32,1)] I used [zeros(32,1); ones(32,1)]. However, this also did not have the desired effect.]_

Channel map (the rows in the data file corresponding to each recording channel): [[1:2:64], [2:2:64]] (so rows 1,3,5,7,...63 in the data file correspond to recording sites on shank 1, rows 2,4,6,....64 contain the data of shank 2).

As far as I am aware, the values of the probe parameters are correct and should not cause any difficulties. However, there might be a problem because they are not in the correct format (e.g. they should be in a row vector instead of a column vector or vice versa).

Do you know whether this is true and if so, what the correct Matlab expressions should be?

hana777 commented 4 years ago

Can somebody answer my question please?

RynzzZ commented 4 years ago

Hi.

I have used the H2 probe from CambridgeNeurotech with KS2. Normally you would expect to create probe map file faithfully reflecting the probe configuration, for example channel1 being the bottom one on one shank, channel32 being the top, same thing for channel 33 and 64. But the thing is that your channel map and site location should also correspond to the associated data file - the CHs.dat file - you imported into KS2 GUI.

I'm not sure what software you use for data collection, but I use openEphys. So the CHs.dat file I imported in KS2 GUI is generated by combining all the CH(number).continuous file together, and which channel the number associated with the .continous file reflects is determined by my channel mapping file loaded in openEphys, which is then determined by how your probe, adaptor and headstage connect together. Eventually, the probe mapping file I loaded in KS2 GUI is not as simple as xcoordinates: [ones(32,1); 250*ones(32,1)]; ycoordinates: [1:(800/32):800, (1:(800/32):800)]. For example, CH1.continuous file actually coorespond to channel 41 on my H2 probe, so the xcoordinates(1) and ycoordinates(1) should be the x and y for channel 41, instead of the bottom channel of the left shank.

Hopefully this might help.

hana777 commented 4 years ago

It did, thank you!