LesionSegmenter: surface all four lesions + upload-time selector - #128
Merged
Conversation
LesionSegmenter's single nnU-Net already computes liver (39), pancreatic (40), kidney (41) and colon (42) lesions in one forward pass, but only pancreatic_lesion was mapped into the viewer; the other three were computed and discarded. This surfaces all four at zero extra runtime. Backend (auto_segmentor.py): - add liver_lesion/kidney_lesion/colon_lesion viewer labels (33/34/35) - map model labels 39/41/42 onto them in _LESIONSEG_TO_VIEWER Frontend: - add the three lesion categories, colors and organ-system placements (kidney_lesion under Urinary/Kidneys, liver/colon_lesion under Digestive) - add a lesion selector under Model when LesionSegmenter is chosen; sends lesion_target with the inference request Only pancreatic_lesion has ground-truth validation on PanTS, so the other three are labelled experimental in the selector.
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
Surfaces all four lesions that LesionSegmenter already produces, and adds a
lesion selector on the upload page.
LesionSegmenter is a single nnU-Net (43 classes) that computes liver (39),
pancreatic (40), kidney (41) and colon (42) lesions in one forward pass.
Until now only
pancreatic_lesionwas mapped into the viewer — the other threewere computed on every run and thrown away at the label-mapping step because the
viewer had no category for them. This PR surfaces all four.
Because it is the same single inference, the other three lesions cost zero
extra runtime, and every existing LesionSegmenter speed optimization applies to
them identically — there is nothing separate to optimize.
Changes
Backend (
flask-server/services/auto_segmentor.py)liver_lesion=33,kidney_lesion=34,colon_lesion=3539/41/42onto them in_LESIONSEG_TO_VIEWERFrontend
(kidney_lesion under Urinary/Kidneys; liver_lesion & colon_lesion under Digestive)
lesion_targetwith the inference request (plumbed for future auto-focus)Only pancreatic_lesion has ground-truth validation on PanTS (PanTS carries no
liver/kidney/colon lesion labels, and no MSD/KiTS/LiTS data is on the server). The
other three are therefore surfaced but labelled "experimental" in the selector.
Recommend keeping that labelling until we obtain a labelled dataset (KiTS/LiTS/MSD)
to validate them properly.
Verification
npm run buildpasses (tsc typecheck + vite build, 18s) on the server toolchain.