Repository navigation
Read renamed iEEG channels as their electrode contacts - #574
Merged
Merged
Conversation
Deploying nemar-website with
|
| Latest commit: |
f1e0afe
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7087112e.nemar-website.pages.dev |
| Branch Preview URL: | https://fix-ieeg-channel-electrode-n.nemar-website.pages.dev |
neuromechanist
added a commit
that referenced
this pull request
Nov 20, 2026
5 tasks done
neuromechanist
added a commit
that referenced
this pull request
Nov 20, 2026
This was referenced Nov 21, 2026
Merged
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.
What
Collaborator pull requests on iEEG mirror datasets now write
channels.tsvnames as the recording headers do (POL A1-AV,EEG G_03-REF,EEGGA_01REF,A1-A2,EEG M2-Ref) whileelectrodes.tsvkeeps the contact names (A1,G03,GA01).The Brain panel and the live Activity view join channels to contacts in one place,
joinChannels(src/lib/ieeg-spatial/geometry.ts) overchannel-match.ts; this PR extends that one rule, no data changes.The rule (
channel-match.ts)Exact name first, then an exact bipolar pair, then, tier by tier, the first tier with one reading decides and two readings refuse:
normalized: whitespace off; a leadingEEGorPOLin upper-case only with spaces, orEEGrun into a shaft letter (EEGGA_01REF), off; compare with the contact name except for leading zeros in the index and an underscore between a shaft letter and the index (not after a digit:G1_2is notG12), on both sides (G_03,G03,G3are one name); a bipolar pairX-Ywhose halves read that way maps to both contacts (midpoint for display), soPOL B1-B2reachesB01andB02.suffix: one trailing reference token off any of those forms:-REF/-Ref(any case, optional number),REFright after the index with no hyphen,-AV, or four-plus digits after a hyphen; then the same comparison.duplicate_contact).New in this PR: the underscore,
REFwithout a hyphen,EEGwith no space, and zero-tolerant bipolar halves.Deliberately not read:
POL $A11(no stated meaning), case-folded contact names (on004624 counts from 0 against a file from 1),POLAR1-style names (POLneeds a space), andX-A1/X-A2as ear references (new pending patternear_reference; where both ends are contacts the name is a bipolar pair).Match table
Electrodes reached by at least one channel, summed over every channels file of the dataset that has an electrodes file beside it (
sourcedata/andderivatives/skipped), measured onmainand on thefix-20261018pull request of each nemarDatasets repository.main, exact namePOL $A11,POL $A12(polarity marker, still refused)POL $A11,POL $A12,POL $B..(same)A..-AVchannels the file lacksWhere the branch reaches fewer electrodes than
main, it has fewer channels: on005545, on006233 and on006914 are bipolar derivations (POL A1-A2, 66 channels for 128 contacts, the monopolar rows moved tosourcedata/channels-removed-2026-10-18), and on005931 keeps half its channels.An independent reading of every unlocated channel (lower case, type word and reference token off, underscore and zeros off, written apart from the module) finds no further contact for any of them, so the counts above are what the names allow.
False-match checks over all eight datasets: no channel reaches a contact of another shaft; no two differently written channels hold one contact or one bipolar pair (adjacent bipolar channels share a contact, as they must).
Residual unlocated channels, by kind: auxiliary (
DC01,SG1,TRIG,OSAT,EKG1), scalp references (EEG C3-Ref), contacts the electrodes file lacks (POL A10,POL A9-A10where there is no A10), and the$marker.POL A1-RefbesideEEG A1-Refin one recording (on004551 sub-051) is refused as a duplicate claim on A1, as designed.Tests
channel-rename.test.ts: real name columns of eleven recordings from the eight datasets (test/fixtures/ieeg-channel-renames/, commit and SHA-256 of each whole file inside), counts per recording, a shaft and unique-claim check, an independent reading that must agree with the module on every channel, and one row per form. No mocks.channel-matchandprovenancetests updated where the sentence or the case rule changed.vitest run: 5675 passed;biome check: clean;astro check: 0 errors.The same rule is in nemarOrg/nemar-cli (
scripts/ieeg_geometry/ieeg_geometry/names.py) for the geometry pipeline, held to the same counts on the same files.Review round: the type word is upper case only (owner, 2026-11-20);
_expected-joins.json(digest pinned) holds the per-channel join of every fixture recording and is byte-identical in nemar-cli; the shaft check is strict (letters equal, per half).