Error converting LFP from raw

Hi,

I'm trying to use IN-brainstorm suite to analyze my data collected using Intan acquisition system (.rhd file). When I was trying to convert LFP from raw, I receive the error message saying 'Index in Position 2 exceeds array bounds' (screenshot attached). I have similar problems when running Waveclus under unsupervised spike sorting. I suspect it might have something to do with the channel file. My recordings contain 64 amplifier channels of normal signal, but also an additional channel that records voltage stimulus. However, the auto-generated channel file only contains 64 channels. I tried editing the channel file by adding a channel, but then the recording cannot be read anymore. Any suggestions?brainstorm_bug

The number of entries in the channel file (in the .Channel field) must correspond to the number of signals in the recordings. The name and type of channels in the channel file created might be incorrect, but the number of channels should always be correct.
You should not try to add or remove channels manually, especially when working with continuous files, which can't be edited from Brainstorm.

If there is something that obviously crashes even when you don't modify the channel file: could you please share a short example file? Upload your files somewhere and post the download link here.
If you can, please extract only one second instead of sending the entire recording session. Then make sure the error can be reproduced with this short file.

@MartinC @Konstantinos

Hi,

Thank you very much for your reply. The problem persists even if I don't edit the channel file. I have uploaded the file to dropbox with the link: https://www.dropbox.com/sh/bpr3big4pxd2pjp/AABpn808Zg9Q8JiGEyheqzJDa?dl=0.
I have also included text files of parameters I used when trying to run Waveclus and Kilosort, both of which cannot be successfully completed.

I really appreciate your help!!

I think I fixed this bug in this commit:
https://github.com/brainstorm-tools/brainstorm3/commit/bab0173f60044f5ff1dcad3a6a982c886a54d35f

@mpompolas @MartinC Can you please confirm it fixes the indexing bug without causing any other damage?

It's working fine on my end, thanks François!

brainstorm_bug2 Thanks a lot! LFP conversion works fine now. However, could you also take a look at an error when I do spike sorting with kilosort? It's also replicable in the data I uploaded previously. I also attached the error message.

@MartinC Can you please have a look at this?
I've never used kilosort...
Thanks

1 Like

Hi,

Thank you for sharing your data. This error is related to the following issue that was reported by another Kilosort user: https://github.com/cortex-lab/KiloSort/issues/44

In the above thread, the KiloSort developer says that this is most likely due to KiloSort not detecting any spikes, and suggests to try lowering the values in ops.Th. I tried this with your data with values ops.Th = [1 2 2]; and the process completed successfully. I suggest you contact the KiloSort developers directly if you have further questions about the parameters.

Best,
Martin