Kilosort icon indicating copy to clipboard operation
Kilosort copied to clipboard

Cannot load .bin file in the most updated kilosort4

Open Virginia9733 opened this issue 10 months ago • 8 comments

Describe the issue:

Cannot load .bin file in the most updated kilosort4

After superconcatenate two sessions recorded by NPX2.0 4-shank alpha, I tried to load the binary file in the Kilosort4.03 D:/data/NeuropixelData/supercat_tr01_OF_test1_g0/tr01_OF_test1_g0_imec0/tr01_OF_test1_g0_tcat.imec0.ap.bin But I have this error message: Non-native QFileDialog supports only local files and I cannot load the file and see the raw data. cannot load  bin file

The channelmap cannot be loaded:

tr01_OF_test1_g0_tcat.imec0.ap_kilosortChanMap.mat

Traceback (most recent call last):

File "C:\Users\muhang\miniconda3\envs\kilosort4\lib\site-packages\kilosort\gui\settings_box.py", line 581, in on_probe_layout_selected

probe_prb = create_prb(probe_layout)

File "C:\Users\muhang\miniconda3\envs\kilosort4\lib\site-packages\kilosort\gui\minor_gui_elements.py", line 18, in create_prb

group_channels = chan_map[channel_group_pos]

IndexError : index 383 is out of bounds for axis 0 with size 383

Reproduce the bug:

No response

Error message:

No response

Version information:

CUDA toolkit11.8 kilosort 4.03

Context for the issue:

No response

Experiment information:

No response

Virginia9733 avatar Apr 10 '24 15:04 Virginia9733

@Virginia9733 is D:\ a network drive for you, or something along those lines?

jacobpennington avatar Apr 10 '24 15:04 jacobpennington

Sorry I was updating the problems, I think it might related to the channel map. I use NPX2.0 4-shank alpha, evenly distributed on the four shanks.

The channelmap cannot be loaded:

tr01_OF_test1_g0_tcat.imec0.ap_kilosortChanMap.mat

Traceback (most recent call last):

File "C:\Users\muhang\miniconda3\envs\kilosort4\lib\site-packages\kilosort\gui\settings_box.py", line 581, in on_probe_layout_selected

probe_prb = create_prb(probe_layout)

File "C:\Users\muhang\miniconda3\envs\kilosort4\lib\site-packages\kilosort\gui\minor_gui_elements.py", line 18, in create_prb

group_channels = chan_map[channel_group_pos]

IndexError : index 383 is out of bounds for axis 0 with size 383

Virginia9733 avatar Apr 10 '24 15:04 Virginia9733

Terribly sorry but now it loaded, but the probes look weird, only two shanks were shown. Screenshot 2024-04-11 003039

Virginia9733 avatar Apr 10 '24 15:04 Virginia9733

Also, sorry for asking a stupid question, but how can I check the current version of KS4, and how can I upgrade it to KS 4.03? I installed it two hours ago, but not sure if it is 4.03.

Virginia9733 avatar Apr 10 '24 15:04 Virginia9733

If you're using conda to manage your environment, you can type conda list kilosort in the terminal to see the version.

As for only two shanks showing, can you paste in the output of "dump probe" here so I can see how Kilosort is reading your probe file? Also, were all 4 shanks actually being recorded from? If the 384 active channels were all from 2 shanks, then only those 2 shanks would show up.

jacobpennington avatar Apr 10 '24 16:04 jacobpennington

packages in environment at C:\Users\muhang\miniconda3\envs\kilosort4:

Name Version Build Channel

kilosort 4.0.3 pypi_0 pypi

IndexError : index 383 is out of bounds for axis 0 with size 383

probe = { 'xc': np.array([ 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32., 0., 32.], dtype=np.float32), 'yc': np.array([ 0., 0., 15., 15., 30., 30., 45., 45., 60., 60., 75., 75., 90., 90., 105., 105., 120., 120., 135., 135., 150., 150., 165., 165., 180., 180., 195., 195., 210., 210., 225., 225., 240., 240., 255., 255., 270., 270., 285., 285., 300., 300., 315., 315., 330., 330., 345., 345., 360., 360., 375., 375., 390., 390., 405., 405., 420., 420., 435., 435., 450., 450., 465., 465., 480., 480., 495., 495., 510., 510., 525., 525., 540., 540., 555., 555., 570., 570., 585., 585., 600., 600., 615., 615., 630., 630., 645., 645., 660., 660., 675., 675., 690., 690., 705., 705., 720., 720., 735., 735., 750., 750., 765., 765., 780., 780., 795., 795., 810., 810., 825., 825., 840., 840., 855., 855., 870., 870., 885., 885., 900., 900., 915., 915., 930., 930., 945., 945., 960., 960., 975., 975., 990., 990., 1005., 1005., 1020., 1020., 1035., 1035., 1050., 1050., 1065., 1065., 1080., 1080., 1095., 1095., 1110., 1110., 1125., 1125., 1140., 1140., 1155., 1155., 1170., 1170., 1185., 1185., 1200., 1200., 1215., 1215., 1230., 1230., 1245., 1245., 1260., 1260., 1275., 1275., 1290., 1290., 1305., 1305., 1320., 1320., 1335., 1335., 1350., 1350., 1365., 1365., 1380., 1380., 1395., 1395., 1410., 1410., 1425., 1425., 1440., 1440., 1455., 1455., 1470., 1470., 1485., 1485., 1500., 1500., 1515., 1515., 1530., 1530., 1545., 1545., 1560., 1560., 1575., 1575., 1590., 1590., 1605., 1605., 1620., 1620., 1635., 1635., 1650., 1650., 1665., 1665., 1680., 1680., 1695., 1695., 1710., 1710., 1725., 1725., 1740., 1740., 1755., 1755., 1770., 1770., 1785., 1785., 1800., 1800., 1815., 1815., 1830., 1830., 1845., 1845., 1860., 1860., 1875., 1875., 1890., 1890., 1905., 1905., 1920., 1920., 1935., 1935., 1950., 1950., 1965., 1965., 1980., 1980., 1995., 1995., 2010., 2010., 2025., 2025., 2040., 2040., 2055., 2055., 2070., 2070., 2085., 2085., 2100., 2100., 2115., 2115., 2130., 2130., 2145., 2145., 2160., 2160., 2175., 2175., 2190., 2190., 2205., 2205., 2220., 2220., 2235., 2235., 2250., 2250., 2265., 2265., 2280., 2280., 2295., 2295., 2310., 2310., 2325., 2325., 2340., 2340., 2355., 2355., 2370., 2370., 2385., 2385., 2400., 2400., 2415., 2415., 2430., 2430., 2445., 2445., 2460., 2460., 2475., 2475., 2490., 2490., 2505., 2505., 2520., 2520., 2535., 2535., 2550., 2550., 2565., 2565., 2580., 2580., 2595., 2595., 2610., 2610., 2625., 2625., 2640., 2640., 2655., 2655., 2670., 2670., 2685., 2685., 2700., 2700., 2715., 2715., 2730., 2730., 2745., 2745., 2760., 2760., 2775., 2775., 2790., 2790., 2805., 2805., 2820., 2820., 2835., 2835., 2850., 2850., 2865., 2865.], dtype=np.float32), 'kcoords': np.array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], dtype=np.float32), 'chanMap': np.array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383]), 'n_chan': 384 }

When I load the KS3 output into phy, it showed 4 shanks, and channels activated. Plus I can have nearly 300 good units after KS3, but only 7 after KS4. phy-kilosort3 phy-kilosort4

Virginia9733 avatar Apr 11 '24 02:04 Virginia9733

@Virginia9733 All of your contacts in that probe layout are from a single shank (you're seeing the two columns that are 32um apart), not spread out over 4 shanks. We are currently recommending people do this intentionally to get around some multi-shank sorting issues that we're working on, but you would need to also add an artificial vertical gap between each shank, around 100um.

Are you using the same channel map file for KS3?

jacobpennington avatar Apr 11 '24 17:04 jacobpennington

@Virginia9733 Another note: the newest version (4.0.4) should fix the multi-shank issues we were seeing, so that vertically stacking shanks is not necessary.

jacobpennington avatar Apr 17 '24 16:04 jacobpennington

I'm going to close this for now. If you continue to have issues with the latest version, please let us know and we can re-open this.

jacobpennington avatar Apr 30 '24 18:04 jacobpennington