feat(ImageResliceMapper): add LABELMAP_EDGE_PROJECTION_BLEND#3541
Open
sedghi wants to merge 1 commit into
Open
feat(ImageResliceMapper): add LABELMAP_EDGE_PROJECTION_BLEND#3541sedghi wants to merge 1 commit into
sedghi wants to merge 1 commit into
Conversation
Label outline rendering on the image reslice mapper previously broke as soon as a slab was active: the border detection compared the slab-composited center value against single-slice neighbors, which classified the entire projected footprint of a label as border and painted it solid. Labels are now projected across the slab (per-label presence bitmask marched in texture space, clamped to the volume so arbitrarily large slab thicknesses only cost the in-volume path) and each label is outlined where its projected footprint ends, probed at that label's own outline thickness. When several labels compete for a fragment, the one nearest the viewer along the slab wins, for both outlines and fill. Adds the LabelmapEdgeProjectionReslice example (reslice-mapper counterpart of LabelmapEdgeProjection) and an image regression test whose label spheres sit away from the slice plane so their outlines can only come from the slab projection.
Contributor
Author
|
Would you be able to review this one @bruyeret thanks! |
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.
Context
This is the reslice-mapper version of the volume mapper's
LABELMAP_EDGE_PROJECTION_BLEND(see the existingLabelmapEdgeProjectionexample): show segmentation edges over a thick-slab MIP.Until now,
useLabelOutlinecombined with a slab was broken — the border check compares the slab-composited center value against single-slice neighbors, so a label's entire projected footprint was painted as border.Results
See: https://cleanshot.com/share/JSbWkTns
With a slab active:
slabThickness === 0keeps the existing single-slice behavior.Screenshots to be added.
New example
LabelmapEdgeProjectionResliceuses the same data and spherical labels asLabelmapEdgeProjection, rendered through the reslice mapper. The slice plane follows the camera so the slab MIP can be rotated.Changes
Sources/Rendering/OpenGL/ImageResliceMapper/index.js: new shader helpers (labelSlabMask,labelSlabBoxSteps,labelSlabFrontLabel) and a new fragment branch for the single-component label outline case withslabThickness > 0.MCVCMatrixis now also declared in the fragment shader for that branch.Examples/Rendering/LabelmapEdgeProjectionReslice/index.js: new example.Sources/Rendering/Core/ImageResliceMapper/test/testImageResliceMapperLabelOutlineSlab.js+ baseline: new image test. The label spheres sit away from the slice plane, so their outlines can only come from the slab projection.No public API changes — the feature activates from the existing
useLabelOutline+slabThicknesscombination.PR and Code Checklist
npm run reformatto have correctly formatted codeTesting
npx vitest run Sources/Rendering/Core/ImageResliceMapper/test/— the new test plus all 7 existing reslice mapper tests pass.npm run example -- LabelmapEdgeProjectionReslice— rotate the view, change the thickness and slab sliders. Slab 0 falls back to the existing path.This change adds or fixes unit tests
Tested environment: