fix(EllipticalROITool) Issue 1294 - Ellipse tool spamming ANNOTATION_MODIFIED events when it is outside volume #1295
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 for Issue 1294
The Ellipse tool is generating excessive ANNOTATION_MODIFIED events when it is placed outside the volume boundaries. This behavior is unexpected and leads to performance issues, such as event flooding and potential application slowdowns.
Issue was generated because of lack area and area units for ellipse annotation with in this specific scenario.
Fixed by allowing calculation of area for ellipse annotation even if it's not in in mage volume.
Changes & Results
Before: Issue 1294 video
After:
https://github.com/cornerstonejs/cornerstone3D/assets/2040590/2884ccf9-d53c-4e6d-a155-d1c7ad5d8387
Testing
yarn run example stackAnnotationTools
Checklist
PR
semantic-release format and guidelines.
Code
(N/A) My code has been well-documented (function documentation, inline comments,
etc.)
(N/A) I have run the
yarn build:update-api
to update the API documentation, and havecommitted the changes to this PR. (Read more here https://www.cornerstonejs.org/docs/contribute/update-api)
Public Documentation Updates
additions or removals.
Tested Environment