Dashboard search overhaul, viewer redesign & performance work#29
Merged
Conversation
Dashboard / search: - Facet-powered filters with live counts via /api/facets - New filters from existing metadata: manufacturer, CT phase, site, study year - URL-encoded, shareable/bookmarkable filtered cohorts + copy-link button - Pagination over results (16/page, 4x4) with prev/next, jump-to-page, and "Browse all" to page the full dataset; lazy-loaded thumbnails - Default grid = fullest-body scans, half tumor / half no-tumor - Accurate organ-class stat (derived from the viewer's label set) Viewer: - Refined dark UI (panels, sliders, segmented controls, checkboxes, chevrons) - Inline Organ Statistics panel (per-organ volume + mean HU via /api/mask-data) - Low-res-first volume loading with an HD toggle; measured download progress bar - Local-first volume loading with HuggingFace fallback - View-switch (MPR/Axial/Sag/Cor/3D) layout + camera fixes - 3D organ loader restored behind an error boundary; report-button feedback Upload: - Client-side pre-inference CT preview (NiiVue, lazy-loaded) Performance: - Route code-splitting (dashboard initial JS ~1.6MB -> ~93KB gzip) - Viewer-chunk prefetch on hover/idle Backend (additive, fallback-safe): - Low-res volume serving via ?res=low on get-main-nifti / get-segmentations - Cache-Control on volume responses - scripts/make_lowres.py batch job to generate low-res CT + mask copies
| # for big full-body scans). Falls back to full res if it hasn't been generated. | ||
| if (request.args.get('res') or '').strip().lower() == 'low': | ||
| low_path = f"{case_dir}/{Constants.MAIN_NIFTI_FILENAME.replace('.nii.gz', '_lowres.nii.gz')}" | ||
| if os.path.exists(low_path): |
| # overlay stays aligned). Falls back to full res below if it hasn't been generated. | ||
| if (request.args.get('res') or '').strip().lower() == 'low': | ||
| low_path = nifti_path.replace('.nii.gz', '_lowres.nii.gz') | ||
| if os.path.exists(low_path): |
| if (request.args.get('res') or '').strip().lower() == 'low': | ||
| low_path = nifti_path.replace('.nii.gz', '_lowres.nii.gz') | ||
| if os.path.exists(low_path): | ||
| response = make_response(send_file(low_path, mimetype='application/gzip')) |
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
Frontend-focused overhaul of the dashboard and viewer, plus additive backend perf work. All reuses existing endpoints — no new routes, no
utils.pyedits.Dashboard / search
/api/facetsloading="lazy"Viewer
/api/mask-data)Upload
Performance
Backend (additive, fully fallback-safe)
?res=lowonget-main-nifti/get-segmentations(falls back to full res if absent)Cache-Controlon volume responsesflask-server/scripts/make_lowres.pybatch job to generate low-res CT + mask copiesDeploy notes
make_lowres.pyon the server (needs writable$PANTS_PATH/data+ disk headroom). Until then, everything serves full-res exactly as before.Testing
tsc -bclean; 32/32 Vitest tests pass (added unit tests for the search helpers); production build succeeds.metadata.xlsx, so volume/organ-stats/report features that need image data show graceful "unavailable" states locally and will populate on the JHU server.