fix(annotation): prevent closed freehand ROI stat mismatch between stack and volume viewports#2717
Open
Devu-trenser wants to merge 6 commits into
Open
fix(annotation): prevent closed freehand ROI stat mismatch between stack and volume viewports#2717Devu-trenser wants to merge 6 commits into
Devu-trenser wants to merge 6 commits into
Conversation
6c4ec85 to
c56b2c2
Compare
|
@sedghi Could you please take a look at this PR ? |
sedghi
reviewed
May 18, 2026
| const zi = Math.round(worldPosIndex[2]); | ||
|
|
||
| kMin = Math.min(kMin, zi); | ||
| kMax = Math.max(kMax, zi); |
Member
There was a problem hiding this comment.
I am not sure about your solution, this might fix in one plane, but in other planes where aquisitino is sag or cor, the issue still exists since you are taking the round on the z no?
Collaborator
|
@sedghi @sen-trenser - I can't reproduce this on viewer-dev |
Contributor
Author
This can be reproduced in viewer-dev while switching between Stack and Volume viewports for a Closed Freehand ROI. Attaching a video for reference. Volume-2717.mp4 |
9f8bcf9 to
88a6c19
Compare
|
@wayfarer3130 Could you please take a look at the above comments from Devu and check the changes? |
wayfarer3130
approved these changes
May 25, 2026
Contributor
Author
|
@sedghi Could you please merge this PR? |
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
Fixes issue: #2646
Fixes the issue where Closed Freehand ROI statistics (especially max) changed when switching between Stack Viewport and Volume Viewport.
The root cause was floating-point precision drift during world-to-index coordinate conversion.
The previous implementation used Math.floor for Z index calculation, which could incorrectly map planar annotations to the previous slice in volume viewports.
This caused ROI statistics to be computed from slightly different voxel regions between stack and volume rendering modes, even though the annotation itself remained visually unchanged.
Changes & Results
Before
After
2026-05-04.12-35-47.mp4
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment