Repository navigation
Viewer: electrode position source in the topomap tooltip, BIDS ALS names (WV1) - #544
Merged
Merged
Conversation
Deploying nemar-website with
|
| Latest commit: |
2b26c94
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fbcbcd40.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-pc-wv1-electrode-pro.nemar-website.pages.dev |
This was referenced Nov 19, 2026
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.
Card WV1. The EEG viewer's topomap tooltip says where a store's electrode positions came from (
subjectordataset, with the file named), never calls them measured, and BIDS's three ALS coordinate-system names are drawn the right way up. Basestagingat afc2204. This PR deploys nothing by itself; a merge intostagingdeploys the test site.Step 0: what the viewer read at the base
src/lib/eeg-viewer/store.ts:RecordingStorefields at lines 82 to 87, parse inopenRecordingat lines 390 to 432. It keepselectrode_positionsentries of three finite numbers, readselectrode_coordinate_systemandelectrode_coordinate_units, and ignores every other root attribute.src/lib/eeg-viewer/viewer.ts: the toggle's title is set once, inbuildDom(lines 2260 to 2279): "Scalp topomap (split panel)", or the montage fallback sentence whenestimated, or a disabled-reason sentence when nothing resolves. The group selector's handler (line 1776) only togglesdisabledand never sets the title.resolveScalpPositions(lines 2655 to 2678) held a local namedmeasuredand a docblock saying the layout "is not measured"; the same wording sat in the comment above the toggle (line 2269). Its two callers (line 688 andbuildDom) are both inviewer.ts.src/lib/eeg-viewer/topo.tsline 25:ALS_SYSTEMSwasEEGLAB,ALS,CTF,4D,KIT, compared aftertoUpperCase(), soEEGLAB-HJ,4DBtiandKitYokogawapassed as RAS and were drawn rotated by 90 degrees.topo.test.tshad twoalsToRastests.Tests: pure helpers under Vitest.
store.test.tsopens a real zarrita store served from an in-memory fetch handler (fakeZarrV3Store);viewer.test.tsimports pure exports fromviewer.ts. No existing test read the electrode attributes.git grep -n electrodePositionsfinds onlystore.ts(the field and its parse) andviewer.ts(resolveScalpPositions). There is no other reader of the positions and no other place that shows store attributes, so the card's assumptions held and nothing stopped the work.What changed
topo.ts:ALS_SYSTEMSgainsEEGLAB-HJ,4DBTIandKITYOKOGAWA(upper case, as the comparison reads them); the five existing entries stay, so no store drawn today moves.store.ts:RecordingStoregainselectrodePositionsSource(subject,datasetor null: any other value, any other case, or absent is null),electrodePositionsFileandelectrodeCoordsystemFile(a non-empty string, else null), read by one exported pure function,parseElectrodeProvenance.viewer.ts: one exported pure function,topoToggleTitle, chooses the toggle's tooltip. Positions from a store withsubjectgive "Scalp topomap - electrode positions from this subject's electrodes file", withdataset"Scalp topomap - electrode positions from one electrodes file shared by every subject", each followed by the file in parentheses when the store names it. A store with no source word (converted before the converter wrote one) keeps the base title, and the montage fallback keeps its sentence. No tooltip uses the words measured, digitized or template.viewer.ts: inresolveScalpPositionsthe localmeasuredbecomesdeclared, and the two comments saying "not measured" now say "not the dataset's own positions". Behavior unchanged.Left alone, outside the card's Scope: two comments in
standard-montage.ts(lines 13 and 420) still use the word "measured" about the standard montage tables.Gates
bun install --frozen-lockfile: no changes.bun run typecheck: 0 errors, 0 warnings, 19 hints (the same 19 hints on the base).bun run lint:Checked 419 files in 215ms. No fixes applied.bun run test:Test Files 175 passed | 3 skipped (178),Tests 4955 passed | 14 skipped (4969).bun run test src/lib/eeg-viewer:Test Files 16 passed (16),Tests 525 passed (525); every test that existed on the base passes unchanged (the only edit to an existing test file's helper is one optionalrootAttrsoption onfakeZarrV3Store).viewer.tsandviewer.test.ts(the check's allowlist lacks it) and that no line of this PR adds.Mutations (each reverted,
git status --porcelainclean after each)4DBTIfromALS_SYSTEMS:alsToRas > turns BIDS's three ALS names like EEGLAB, in any letter casefails withexpected [ 1, 2, 3 ] to deeply equal [ -2, 1, 3 ], and the4DBtiprojection test fails too.parseElectrodeProvenance > gives null for any other word, any other case, any other type, and absencefails withexpected 'Subject' to be null.topoToggleTitle:keeps the base title for a store converted before the attributes existedfails withexpected 'Scalp topomap - electrode positions f…' to be 'Scalp topomap (split panel)'.parseElectrodeProvenancespread inopenRecording(the wiring): bothopenRecording carries the provenance...tests fail withexpected undefined to be 'dataset'andexpected undefined to be null.Not run
staging, a store with adatasetsource on test.nemar.org should show the clause with the file, and a store converted before the converter wrote the attributes should show the base title, because this card makes no deploy and runs no browser.topoBtn.title = topoToggleTitle(scalp, store)inbuildDom, becausebuildDomneeds a DOM and the suite is pure-helper tests; typecheck pins the argument shape.Prepare release, any deploy, any merge, any version change.Review round 1 (head 2b26c94)
The review of 8ac618a found no critical or important issue. Changes after it:
parseElectrodeProvenancenow accepts a path (electrode_positions_file,electrode_coordsystem_file) only when it is a trimmed, single-line string of at most 200 characters with no control, invisible or direction-changing character (Unicode categories Cc, Cf, Zl and Zp), and repository-relative: no leading/, no backslash anywhere, noscheme:prefix such ashttp:,file:or a drive letter. Any other path makes the file unknown (null) and leaves a valid source word alone, so the tooltip then shows the sentence without a file.file:andhttps:prefixes, a colon after a folder name kept). Each fails under one mutation, reverted after each: dropCcfrom the class (control test), dropCf(invisible test), drop the length cap, drop the trim check, drop the leading-slash check, drop the backslash check, drop the scheme check, treat any colon as a scheme, read the wrong attribute for the coordsystem file, reject any slash (normal-path test).resolveScalpPositionsdocblock now says "The coordinates the store carries from its electrodes file".bun run teston 2b26c94 readsTest Files 175 passed | 3 skipped (178)andTests 4965 passed | 14 skipped (4979)(the earlier "4955 passed" figure was from before this round's ten new tests; a reviewer run that measured 4952 passed | 17 skipped on 8ac618a had three more skips in its environment, the same 4969 total).bun run test src/lib/eeg-viewerreadsTests 535 passed (535),bun run typecheck0 errors, 0 warnings, 19 hints,bun run lintChecked 419 files in 291ms. No fixes applied.Known wording limit, left as the card decided and pinned by tests: a store with a source word and a named file but fewer than three valid position rows falls back to the standard montage, and the tooltip then keeps the montage sentence ("dataset ships no electrodes.tsv").