You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This migrates read_spikegadgets to use build_neuropixels_probe + get_slice, the same pattern that read_spikeglx (#232), read_openephys (#406, #409), and read_imro (#410) already follow. Instead of constructing probe geometry from scratch by parsing XML coordinates, the reader now builds the full 960-contact catalogue probe and slices it to the active electrodes using the channelsOn bitmask. Device channel indices are mapped from the SpikeNTrode hwChan attributes. This was the last Neuropixels reader that bypassed the catalogue (#405).
The SpikeGadgets XML format does not include the probe part number, so I hardcode "NP1000" for the catalogue lookup. I verified that all 10 staggered NP 1.0 variants in the catalogue (NP1000, NP1001, NP1010-NP1014, PRB_1_2_0480_2, PRB_1_4_0480_1, PRB_1_4_0480_1_C) share identical 2D geometry: contact positions, pitch, stagger, shank width, tip length, shank length, contour, electrode count, and ADC/MUX tables. The only fields that differ are metadata (description, datasheet, is_commercial) and shank_thickness_um (Z-axis), none of which probeinterface uses. Because we cannot attribute a specific part number, model_name and description are cleared after slicing. This assumption would be wrong for NP1015-NP1017 (NHP linear) and NP1300 (Optopix), but the SpikeGadgets headstage is documented as supporting standard rodent Neuropixels 1.0 probes, which are the staggered variants.
The newer Bennu datalogger (https://spikegadgets.com/products/bennu-neuropixels-datalogger/) advertises NP 2.0 support. When .rec files from that device become available, we will need test data and likely a way to detect the probe type from the XML to extend this reader.
@alejoe91 I added the example you shared recently to the repo.
The reader now branches on SpikeConfiguration.device and hardcodes NP2014 for the NP2 path (same geometry-equivalence argument as NP1000: all 4-shank NP2 catalogue variants share 2D geometry). I also dropped the channelsOn bitmask and derive active electrodes from SpikeNTrode elements for both NP1 and NP2, because on your NP2 file channelsOn is packed differently (692 bytes) and individual_channel_toggling is all -1. The SpikeNTrode-derived set matches the bitmask exactly on NP1, so this is a refactor, not a behavior change.
Your example only activates one shank, so we are still missing a true 4-shank example, but I guess that can be done later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This migrates
read_spikegadgetsto usebuild_neuropixels_probe+get_slice, the same pattern thatread_spikeglx(#232),read_openephys(#406, #409), andread_imro(#410) already follow. Instead of constructing probe geometry from scratch by parsing XML coordinates, the reader now builds the full 960-contact catalogue probe and slices it to the active electrodes using thechannelsOnbitmask. Device channel indices are mapped from the SpikeNTrodehwChanattributes. This was the last Neuropixels reader that bypassed the catalogue (#405).The SpikeGadgets XML format does not include the probe part number, so I hardcode
"NP1000"for the catalogue lookup. I verified that all 10 staggered NP 1.0 variants in the catalogue (NP1000, NP1001, NP1010-NP1014, PRB_1_2_0480_2, PRB_1_4_0480_1, PRB_1_4_0480_1_C) share identical 2D geometry: contact positions, pitch, stagger, shank width, tip length, shank length, contour, electrode count, and ADC/MUX tables. The only fields that differ are metadata (description, datasheet, is_commercial) and shank_thickness_um (Z-axis), none of which probeinterface uses. Because we cannot attribute a specific part number,model_nameanddescriptionare cleared after slicing. This assumption would be wrong for NP1015-NP1017 (NHP linear) and NP1300 (Optopix), but the SpikeGadgets headstage is documented as supporting standard rodent Neuropixels 1.0 probes, which are the staggered variants.The newer Bennu datalogger (https://spikegadgets.com/products/bennu-neuropixels-datalogger/) advertises NP 2.0 support. When
.recfiles from that device become available, we will need test data and likely a way to detect the probe type from the XML to extend this reader.