Fix CV viewer hang + dataset counts in filter panel#82
Merged
Conversation
VisualizationPage: detect CV cases (id starts with "CV") and set segUrl to
null — skips the /api/get-segmentations call that returns JSON {"masks_available":false}
instead of a binary NIfTI, which previously hung the loader indefinitely. Also
guards the HuggingFace fallback URL so getPanTSId's garbage output for CV ids
never produces a bad URL.
Homepage/api_blueprint: /api/facets now returns dataset_counts {PanTS, CancerVerse}
(total row counts from DF / DF_CV). Dataset filter buttons display the count badge
matching the style of every other filter option.
aperson30
added a commit
that referenced
this pull request
Jul 18, 2026
The load-effect guard required !segUrl to be false before proceeding, so CV cases (where PR #82 sets segUrl=null) never got past it — CT never loaded and the spinner ran forever. Three edits: 1. Component-level isCvCase flag (pantsCase starts with "CV") so the guard can distinguish "CV, intentionally no seg" from "sources not resolved yet" 2. Guard: (!segUrl && !isCvCase) — CV is CT-only; seg is only required for non-CV cases 3. renderVisualization call: segUrl ?? undefined — converts null to undefined to match the string|undefined signature and avoid tripping downstream seg logic
3 tasks
harleensachdev
pushed a commit
to harleensachdev/BodyMaps-website
that referenced
this pull request
Jul 19, 2026
PR BodyMaps#82 set segUrl=null for CV cases to skip the JSON-returning seg endpoint, but the load-effect guard blocked on !segUrl, so the CT never loaded and the spinner ran forever. Three edits: 1. Component-level isCvCase flag so the guard can distinguish "CV, intentionally no seg" from "sources not resolved yet" (both start as null) 2. Guard: (!segUrl && !isCvCase) — seg only required for non-CV cases 3. renderVisualization: segUrl ?? undefined — null → undefined matches the string|undefined signature and avoids tripping downstream seg logic
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
VisualizationPage.tsxnow detects CV cases (idstarts with"CV") and setssegUrltonullinstead of calling/api/get-segmentations/CV_…. That endpoint returns{"masks_available": false}(JSON, HTTP 200) which the NIfTI loader treats as a binary volume and hangs indefinitely. Settingnullgives the same CT-only path asisLocal/isDicomcases.getPanTSIdproduces a garbage value for CV ids;pis now set to""for CV cases so no malformed HuggingFace URL is constructed if the JHU server goes down./api/facetsnow includesdataset_counts: {PanTS, CancerVerse}(total row counts fromDF/DF_CV). The Dataset filter buttons in the advanced search panel now show count badges matching the style of Tumor, Sex, etc.Test plan
/case/CV_00000001) — viewer loads CT, no hang, organ panel shows CT-only (no mask list)npm test— 103 tests pass, no regressionstsc -b— clean