fix(zoom): fix Stack to Volume Fusion and Viewport zoom preservation #1997
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.
fixes #1996
This pull request includes significant changes to the
stackToVolumeFusionexample, improvements to theBaseVolumeViewportclass, and updates to the testing configuration and test cases. The most important changes are detailed below.New Example Implementation:
packages/core/examples/stackToVolumeFusion/index.ts: Added a new example demonstrating stack to volume fusion and volume with labelmap segmentation. This includes initializing the rendering engine, creating viewports, and setting up volumes and segmentations.Rendering Engine Enhancements:
packages/core/src/RenderingEngine/BaseVolumeViewport.ts: Updated theBaseVolumeViewportclass to handle cases wherevolumeIdis undefined and to correctly set the camera focal point and position based on the image position and normal direction. [1] [2] [3]packages/core/src/RenderingEngine/Viewport.ts: Modified theViewportclass to use the default actor's bounds for computing visible prop bounds, improving the accuracy of the camera's focal point.Testing Configuration and Test Cases:
playwright.config.ts: Increased the number of workers in CI from 4 to 12 to speed up test execution.tests/stackToVolumeFusion.spec.ts: Added a new test case to verify the display of a single DICOM series in a volume viewport and take a screenshot for visual verification.tests/utils/screenShotPaths.ts: Updated the screenshot paths utility to include paths for the newstackToVolumeFusionexample.CC @wayfarer3130