Fix: Segmentation Hide All fails when switching from 2D to 3D fourUp (#5995)

* Fix: Segmentation "Hide All" fails when switching from 2D to 3D four-up viewport

* Update based on the review comment on segmentation load in 3d fourup

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix: simplify the conditional logic

* fix: playwright test

* fix: playwright test

* fix: render timeout in test

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Belbin-GK <150322972+Belbin-GK@users.noreply.github.com>
Co-authored-by: Devu Jayalekshmi <devu.jayalekshmi@trenser.com>
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
This commit is contained in:
nithin-trenser 2026-06-25 00:48:16 +05:30 committed by GitHub
parent 589d6a1506
commit ee165b4d8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 6 deletions

View File

@ -88,12 +88,17 @@ const segmentationRepresentationModifiedCallback = async (
return;
}
// Ensure the segmentation representation aligns with the target viewport type.
const type: Enums.SegmentationRepresentations =
isVolume3DViewportType(viewport)
? Enums.SegmentationRepresentations.Surface
: ((segmentationRepresentationType as Enums.SegmentationRepresentations) ??
Enums.SegmentationRepresentations.Labelmap);
// Ensure the segmentation representation aligns with the target viewport type
const is3D = isVolume3DViewportType(viewport);
const requestedRepresentation =
segmentationRepresentationType as Enums.SegmentationRepresentations;
const { Surface, Labelmap } = Enums.SegmentationRepresentations;
const type: Enums.SegmentationRepresentations = is3D
? Surface
: requestedRepresentation && requestedRepresentation !== Surface
? requestedRepresentation
: Labelmap;
await segmentationService.addSegmentationRepresentation(targetViewportId, {
segmentationId,

View File

@ -60,6 +60,9 @@ test.describe('3D four up SEG hydration', async () => {
// Wait until all viewports have finished rendering
await viewportRenderCycle;
// Hydration propagates labelmap volumes to MPR viewports asynchronously after the
// first render cycle resolves.
await waitForViewportsRendered(page, { timeout: 240000 });
await checkForScreenshot({
page,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 KiB

After

Width:  |  Height:  |  Size: 538 KiB