Add probe geometry extraction for SpikeGLX Neuropixels data#93
Merged
stevevanhooser merged 4 commits intomainfrom Apr 5, 2026
Merged
Add probe geometry extraction for SpikeGLX Neuropixels data#93stevevanhooser merged 4 commits intomainfrom
stevevanhooser merged 4 commits intomainfrom
Conversation
…eta files Parses electrode positions from ~snsGeomMap (preferred, newer SpikeGLX) or computes them from ~imroTbl + probe type (fallback for older files). Returns a struct matching the NDI probe_geometry document fields. Supports NP 1.0 (type 0), NP 2.0 single shank (types 21/2003/2004), NP 2.0 four shank (types 24/2013/2014), and NP Ultra (types 1100/1110). https://claude.ai/code/session_01AiMXe9VfSzfRaNih6f7a76
Contributor
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
==========================================
- Coverage 29.24% 28.54% -0.70%
==========================================
Files 91 92 +1
Lines 4469 4578 +109
==========================================
Hits 1307 1307
- Misses 3162 3271 +109 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tests cover all code paths: - snsGeomMap parsing (preferred path, newer SpikeGLX) - imroTbl computation for NP 1.0 (type 0, staggered layout) - imroTbl computation for NP 2.0 single shank (type 21) - imroTbl computation for NP 2.0 four shank (type 24) - Output struct field presence and sizes - Error cases (missing geometry info, unsupported probe type) - Bank selection for NP 1.0 - Sync channel exclusion https://claude.ai/code/session_01AiMXe9VfSzfRaNih6f7a76
nargin counts testCase as the first argument, so the default check for bank_values should be nargin < 3, not nargin < 4. https://claude.ai/code/session_01AiMXe9VfSzfRaNih6f7a76
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a new function to extract probe geometry information from SpikeGLX .meta files and convert it to the NDI probe_geometry document format. This enables proper spatial representation of electrode positions for Neuropixels recordings.
Key Changes
probeGeometry(): Main entry point that reads a SpikeGLX .meta file and returns a structure with electrode positions and probe metadata matching the NDI probe_geometry specificationsnsGeomMapfield for newer SpikeGLX versions (>= 20230202) which directly provides electrode coordinatesimroTbland probe type for older filesfind_meta_field(): Locates fields in meta struct accounting for name transformationsparse_snsGeomMap(): Parses the newer geometry formatcompute_geometry_from_imro(): Reconstructs electrode positions from imroTbl entriesprobe_type_info(): Maps probe types to model names and contact sizesImplementation Details
https://claude.ai/code/session_01AiMXe9VfSzfRaNih6f7a76