SpikeInterface / spikeinterface

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

Decompress Zarr to Binary Files #3529

Open atombysx opened 5 days ago

atombysx commented 5 days ago

Hi all, this is particularly about spikeinterface backward-compatibility with SpikeGLX/catGT: I'm currently compressing two NPX2.0 probes recordings with WavPack (Zarr) and save as Zarr and it seems very good in terms of compression (~60-70% reduced). But one concern is how easy it is to convert back to spikeGLX binary files as we have NIDQ events recorded and need to synchronise the two probes or something we miss before compression and we can revert back to do catGT preprocessing. Any chance spikeinterface has an easy way to deal with this?

h-mayorquin commented 1 day ago

Hi, as far as I know, there is no way in Spikeinterface to accomplish this. I would suggest that the better way around this would be to implement the routine of catGT on spikeinterface. Altought, there must be a good reason why we don't have something like this yet. Any ideas @alejoe91 ?

alejoe91 commented 19 hours ago

We do have a catgt like processing available. This is essentially a highoass filter + phase shift + CMR. You van check out a tutorial here: https://spikeinterface.readthedocs.io/en/stable/how_to/analyze_neuropixels.html

For synchronization, you should read and store the nidq events separately from the recording. Note that if you use the 385th channel, you can also load that into spikeinterface with the load_sync_channel=True option in the read_spikeglx function

h-mayorquin commented 13 hours ago

Oh, I stand corrected. I could not find a reference to catGT in the preprocessing section which is where I expected:

https://spikeinterface.readthedocs.io/en/stable/how_to/analyze_neuropixels.html#preprocess-the-recording

Two questions and I guess we can close this issue: 1) Should we mention in the analysis of neuropixels how to that that preprocessing is like catGT? 2) Do you think it would be useful for users to have a preprocessing step call catGt that just applies highpass filter + phase shift + CMR as a pipe?

alejoe91 commented 12 hours ago

hey @h-mayorquin

  1. Yes we should definitely mention that this is similar to CatGT!
  2. I don't think we should. I think our API is clearer and also instructive :) Having a tutorial that shows the chain and explains the different steps is good enough for me (but we should make it more discoverable)
h-mayorquin commented 12 hours ago

Makes sense, another reason against 2 is that it will tie us to a level of support that we might now want as we have discussed previously with quality metric naming. I can do the brief correction on the how-to when I have some time.

atombysx commented 10 hours ago

Hi all, thanks for the answers. I can do most of the things with spikeinterface and I guess I can just convert the spikeinterface binary file to spikeGLX format if necessary. Is there any documentation of the format of the spikeinterface binary file?