SpikeInterface / SpikeInterface/spikeinterface
get_neuropixels_sample_shifts_from_probe does not work for NPX2 4sh with ONIX
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 847
- Forks
- 280
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 29
Description
Hi there,
I have been trying to estimate the sample shift using the function "get_neuropixels_sample_shifts_from_probe", but it throws the following error.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[79], line 3
1 from spikeinterface.extractors.neuropixels_utils import get_neuropixels_sample_shifts_from_probe
----> 3 sample_shifts = get_neuropixels_sample_shifts_from_probe(np2_config_b)
File [E:\py_script\spikeinterface\src\spikeinterface\extractors\neuropixels_utils.py:28](file:///E:/py_script/spikeinterface/src/spikeinterface/extractors/neuropixels_utils.py#line=27), in get_neuropixels_sample_shifts_from_probe(probe, stream_name)
11 """
12 Get the inter-sample shifts for Neuropixels probes based on the probe information.
13
(...)
25 Array of relative phase shifts for each channel.
26 """
27 # get inter-sample shifts based on the probe information and mux channels
---> 28 model_description = probe.annotations.get("description", None)
29 num_channels_per_adc = probe.annotations.get("num_channels_per_adc", None)
30 mux_channels = probe.contact_annotations.get("mux_channels", None)
AttributeError: 'ProbeGroup' object has no attribute 'annotations'`
The "np2_config_b" is loaded from a JSON file for a 4-shank NPX2 probe.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/spikeinterface/extractors/neuropixels_utils.py at get_neuropixels_sample_shifts_from_probe, then inspect how the 4-shank NPX2 configuration is loaded from JSON. Reproduce the call with np2_config_b and verify that the function handles the resulting ProbeGroup and returns the expected sample shifts without the AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100