Fix: FreeHandRoiTool Statistics Text Not Displayed#2723
Open
nithin-trenser wants to merge 1 commit into
Open
Conversation
|
@sedghi Could you please take a look at this PR and provide your feedback? |
|
|
||
| if (annotation.invalidated) { | ||
| const { data, invalidated } = annotation; | ||
| const cachedStats = data && data.cachedStats; |
Collaborator
There was a problem hiding this comment.
data?.cachedStats please
|
|
||
| for (let j = 0; j < points.length; j++) { | ||
| const worldPosIndex = indexPoints[j].map(Math.floor); | ||
| const worldPosIndex = indexPoints[j].map((v) => Math.floor(v + 1e-3)); |
Collaborator
There was a problem hiding this comment.
This isn't clear why you are doing this, nor that it is valid for things like WSI images.
wayfarer3130
requested changes
Jun 11, 2026
wayfarer3130
left a comment
Collaborator
There was a problem hiding this comment.
Can you strip out the changes for worldPosIndex, or if they are really needed, then give a good explanation and make sure it really works reliably for data like WSI.
If you need ceiling/floor differences, then calculating both ceiling and floor rather than trying to do some not understandable logic that might not work reliably.
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
Fix issue: #2645
After drawing an annotation using the PlanarFreeHandRoiTool, the statistics text (such as area, mean, etc.) is not displayed next to the annotation when switching from 2D MPR view to Frame view. The ROI is created and rendered correctly on the viewport, but the associated statistics label is missing.
Changes & Results
Added an additional condition to ensure statistics are recalculated when cached stats for the current
targetIdare missing. The check now triggers when the annotation is invalidated or when the cached statistics for the specified target are not available, preventing missing measurement values.fix-freehand-roi-stat-display.mp4
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment