SpikeInterface / spikeinterface

A Python-based module for creating flexible and robust spike sorting pipelines.
https://spikeinterface.readthedocs.io
MIT License
486 stars 187 forks source link

channel map discrepancy, spikeinterface 0.98.1, probeinterface 0.2.18, read_openephys #2034

Closed gmaggi closed 11 months ago

gmaggi commented 11 months ago

Hi,

We are using spikeinterface 0.98.1 and probeinterface 0.2.18 (just updated via pip install git+https://github.com/SpikeInterface/probeinterface.git).

A user has found a discrepancy between the channel map (.prb file) that is given as an input to read_prb at probeinterface. She uses cambridge neurotech probe. The .prb file is attached as .txt CambridgeNT_H5_CB.txt

we ran the following function for the extractor part:

Screen Shot 2023-09-21 at 2 23 31 PM

Then the user runs kilosort2

The output generated (here visualized with phy2): MicrosoftTeams-image (10)

Many channels seem to be missing. I expect 64 channels with this geometry:

MicrosoftTeams-image (11)

Any help would be much appreciated.

alejoe91 commented 11 months ago

Hi @gmaggi

The probe is loaded correctly on my side:

import probeinterface as pi
from probeinterface.plotting import plot_probegroup

probegroup = pi.read_prb("/home/alessio/Downloads/CambridgeNT_H5_CB.txt")
plot_probegroup(probegroup)

image

Even after loading it into a "fake" spikeinterface recording, the probe appears correct:

import spikeinterface as si
import spikeinterface.widgets as sw

rec = si.generate_recording(num_channels=72)
rec_prb = rec.set_probes(probegroup)

sw.plot_probemap(rec_prb)

image

Note that KS removes channels with low activity. So that might be the reason. You can try to export_to_phy from SpikeInterface!

gmaggi commented 11 months ago

@alejoe91 Thank you very much for your help and great support.