Repository navigation
feat(laparoscopy): assisted segmentation, guided tutorial, per-user label colours - #112
Merged
Merged
Conversation
homarone00
approved these changes
Oct 16, 2026
homarone00
left a comment
Collaborator
There was a problem hiding this comment.
great work, nice features
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 and why
Assisted segmentation (Assist). In laparoscopy Annotation Mode, Segment by clicking turns positive/negative clicks into a mask from a SurgiSAM2 model running on the DjangoWorker GPU worker. The mask is applied as one undoable edit and can be tracked onto the next N frames (0–50), but only where the label is still empty. Tracked frames are saved through the existing autosaver, so they can't conflict with brush saves.
ws/assist/<domain>/<patient_id>/,common/consumers.py) checks write access and theassisted_segmentationmethod against the patient's own project. It finds the video from the patient, never from the browser, and opens the worker session itself.presign_get, the same function the runner uses for cluster jobs).ASSIST_WORKER_URL/ASSIST_WORKER_TOKENset (empty hides it), and write access.setup_laparoscopy_modalitiesdoes the same for new ones.Tutorial. A guided tour of quadrant marking and Annotation Mode (driver.js 1.9.0 from jsDelivr, pinned with SRI; its stylesheet is vendored because the CSP
style-srcis'self'). CONTRIBUTING's CDN section is updated.Labels. Adding, renaming and retiring segmentation labels and quadrants is now project-admin only (it was write access). Colours become personal: each user's choice is stored in
UserPreference.label_colors(migration 0062) and only they see it. Behaviour change: annotators can no longer manage labels, and a label's shared default colour is fixed once it's created.Annotation Mode, smaller changes.
Deployment. New optional settings
ASSIST_WORKER_URL,ASSIST_WORKER_TOKENandASSIST_CONNECT_TIMEOUT, documented in.env.exampleanddocs/setup.md§8. The worker must be able to reach this deployment'sOBJECT_STORAGE_ENDPOINT_URLand must list its origin in its ownVIDEO_SOURCE_ORIGINS.Impact on other domains (reviewed):
image-segment.jschanged./maxillo/(maxillo/app_urls.py), where the rules are now stricter. No maxillo page calls them.UserPreference: gets one new column only (label_colors).bs-compat.cssgives.btn-group > .btnposition: relativeand a raised z-index on hover/focus/active, matching Bootstrap's own rule. That covers 9 templates across domains.How it was checked
common/tests_assist.py: the relay refuses anonymous users, viewers, projects without the method, unconfigured deployments and other files; it frees the worker session on leave; relays worker errors; the worker gets a signed link, never the key.frontend/tests/segmentAssist.test.js.python manage.py testpasses against MySQL: the full suite (1416 tests) passed before the signed-link change;common.tests_assist,laparoscopyandannotationwere re-run after it.makemigrations --checkis clean.ruff check .andlint-importspass (no new exceptions inpyproject.toml).npm run buildleaves no diff (the bundle is up to date);npm testpasses (891);npm run verifyis OK.Core paths
.github/CODEOWNERS(common/models.py,common/migrations/0062–0063,yggdrasil/settings.py). A maintainer has signed off: @maintainerData and privacy