Skip to content

fix: isolate segment definitions by image - #1015

Open
PaulHax wants to merge 6 commits into
Kitware:mainfrom
PaulHax:image-segment-ownership
Open

PaulHax wants to merge 6 commits into
Kitware:mainfrom
PaulHax:image-segment-ownership

Conversation

@PaulHax

@PaulHax PaulHax commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Deleting or renaming a segment while viewing one base image also changed every other image, because all images shared one segment catalog. Each image now owns its segment definitions, order and selection, shared by Paint, rectangles, polygons and rulers on that image.

The goals are:

  • Keep images independent. Editing one image's segments does not change another image's set.
  • Carry setup forward. A new image copies the last active image's definitions, order and selection, with fresh identities and no masks or shapes. With no previous set, it uses configured defaults.
  • Allow immediate editing. Incoming definitions can replace an untouched inherited set. Once edited, that set remains the destination for incoming segments; explicit configs can still update names and appearance.

The untouched/edited distinction matters when an image appears before its matched segmentation finishes decoding, or a later restore targets the same image. Starting an annotation, painting, or changing the segment setup protects it from wholesale replacement. Selecting a row alone does not. Switching back to an initialized image simply restores its own set.

Situation Result
First view or edit, with no existing set Copy the previous image's setup, or use configured defaults.
Return to an initialized image Keep its own set; do not copy again.
Config loaded alone Apply to the image active when loading started; also update starting defaults. With no active image, update defaults only.
Config loaded with images Apply to that batch's loaded images, replacing untouched inherited sets; also update starting defaults.
Matched segmentation files on initial load Replace an untouched inherited set with configured defaults, then bind incoming labels by name. If edited meanwhile, keep the set and bind into it.
Saved session Replace untouched inherited sets with saved sets; merge into edited sets. If a segment config is loaded alongside the session, apply it after restore.

“Matched segmentation files” means labelmaps associated with the primary image chosen for the initial load: filename matches such as scan.seg.nii.gz or scan.seg.nrrd for scan.nrrd (the seg marker is configurable), or DICOM SEG volumes from the same study. File format alone does not establish the association. See the matching path.

Matching names does not merge or overwrite existing voxels. Labelmap import reuses an exact-name segment only if it has no mask; session restore requires no mask or shape. Otherwise the incoming segment gets a numbered name such as Tumor (2). Configs deliberately reapply names and appearance; removing a config entry only deletes a row that the config created and that has no mask or shape. See segment matching and configuration behavior.

Configuration, processing results and image removal are scoped to their destination images. Manifest 8.0.0 saves per-image membership, order, selection and defaults, and the migration splits older shared catalogs into independent per-image sets without duplicating voxels.

This replaces #1005 with the same per-image model but without deferred initialization or a loading state.

@netlify

netlify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit cc3204a
🔍 Latest deploy log https://app.netlify.com/projects/volview-dev/deploys/6af11ae70ff362ac5c900e1c
😎 Deploy Preview https://deploy-preview-1015--volview-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@PaulHax
PaulHax force-pushed the image-segment-ownership branch 2 times, most recently from 72ed5b0 to e9505e6 Compare November 7, 2026 19:11
@PaulHax
PaulHax force-pushed the image-segment-ownership branch from e9505e6 to bf32699 Compare November 8, 2026 15:45

This branch has not been deployed

No deployments
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