Skip to content

LesionSegmenter: surface all four lesions + upload-time selector - #128

Merged
aperson30 merged 1 commit into
mainfrom
feat/lesionsegmenter-4-lesions
Aug 6, 2026
Merged

LesionSegmenter: surface all four lesions + upload-time selector#128
aperson30 merged 1 commit into
mainfrom
feat/lesionsegmenter-4-lesions

Conversation

@aperson30

Copy link
Copy Markdown
Collaborator

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_lesion was mapped into the viewer — the other three
were 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)

  • New viewer labels liver_lesion=33, kidney_lesion=34, colon_lesion=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_lesion & colon_lesion under Digestive)
  • Add a Lesion selector under Model when LesionSegmenter is chosen; it sends
    lesion_target with the inference request (plumbed for future auto-focus)

⚠️ Accuracy note

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 build passes (tsc typecheck + vite build, 18s) on the server toolchain.

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.
@aperson30 aperson30 closed this Aug 6, 2026
@aperson30 aperson30 reopened this Aug 6, 2026
@aperson30
aperson30 merged commit 36508fe into main Aug 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant