Repository navigation
feat(viewer): EGI/BioSemi named-net topomap fallback (nemar-cli#855) - #136
Merged
Merged
Conversation
Two participant-count regressions on /discover: - Browse range / multi-modality filters were applied to a single 10-row page while the count + pager used the server total, so "min 100 participants" showed "642 datasets, 65 pages" with most pages empty. Now fetch the full server-prefiltered set (listAllDatasets, paging past the 200 cap), filter as a unit, and paginate client-side so the count + pager are honest. - Search-result cards lost their subject count: hydration via /datasets/:id returns participants + latest_version as null, which overwrote the search projection's good values. backfillSearchHit restores them. typecheck clean, 615 tests pass.
Replace the dead "Has 10-20 montage" checkbox with a Channels & montage group: a channel-density dropdown (low/standard/high/ high-density) and an electrode-system dropdown (10-20/10-10/10-05/ BioSemi/EGI geodesic/other). Both are disabled with a "Soon" note pointing at nemar-cli#854, which adds the n_channels + electrode_system catalog fields the filter needs. Drops the now-unused has10_20 FilterState field + has_1020 param.
Datasets that ship no electrodes.tsv but use a recognizable EGI geodesic (E1..E128/E256 + Cz) or BioSemi high-density (A1..H32) cap got no scalp topomap, because those labels don't resolve against STANDARD_1005 (e.g. HBN OpenNeuro mirrors like on005516, whose source has no electrode positions). Vendor the canonical positions for GSN-HydroCel-129/257 and biosemi128/256 from MNE (net-montages.ts, same head frame as STANDARD_1005) and consult them in standardMontageFor when the cap is detected. The net is authoritative for its own cap (some bank labels like C1/F1 also exist in 10-05 but sit elsewhere), and BioSemi's A-bank disambiguates the E* label overlap. Result is flagged estimated by the caller, like the existing 10-20 fallback. Closes nemarOrg/nemar-cli#855.
Deploying nemar-website with
|
| Latest commit: |
adba084
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d531aae5.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-issue-855-net-montag.nemar-website.pages.dev |
The BioSemi A-bank probe tripped on a plain 10-20 montage: the A2 ear reference matches /^A\d/ and F3/F4/C3/C4 match [A-H]\d, so a standard cap with an A1/A2 ref was projected onto a BioSemi head. Require the bank labels to be a majority (>=60%) of the channels -- a real BioSemi cap is almost all A1..H32, a 10-20 only a few. Falls through to STANDARD_1005 otherwise. Regression test from nm000109.
4 tasks done
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
Datasets that ship no
electrodes.tsvbut use a recognizable EGI geodesic (E1..E128/E256+Cz) or BioSemi high-density (A1..H32) cap now get an estimated scalp topomap. Previously those labels didn't resolve againstSTANDARD_1005, so the viewer drew no topo — e.g. HBN OpenNeuro mirrors likeon005516, whose source ships no electrode positions (verified: 404 at OpenNeuro), unlike the curatednm000103.How
net-montages.ts— canonical positions forGSN-HydroCel-129,GSN-HydroCel-257,biosemi128,biosemi256, vendored from MNE in the same head/RAS frame asSTANDARD_1005, soprojectPositionshandles them identically.standardMontageForconsults a detected net first (it's authoritative for its own cap: bank labels likeC1/F1also exist in 10-05 but sit elsewhere). BioSemi's A-bank disambiguates theE*label overlap (BioSemi-256 also hasE1..E32). Net size is read from the highest bank/number.estimated: true(same as the existing 10-20 fallback), so a measuredelectrodes.tsvalways wins.biosemi64/32use standard 10-10 labels, so they already resolved and aren't vendored.Why this and not import-side synthesis
The OpenNeuro source genuinely lacks
electrodes.tsv— the NEMAR import is faithful, nothing was dropped (see nemar-cli#855). Estimating from the named cap fixes the whole class of named-net datasets without mutating any dataset files.Testing
standard-montage.test.ts: 13 tests (EGI 129/257 selection, BioSemi 128/256, A-bank disambiguation, case-insensitivity, standard-set precedence). Validated against real HBN labels (E1..E128+Cz).Regenerating the vendored tables
Closes nemarOrg/nemar-cli#855.