-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(contour): improved performance and better configuration #543
Merged
Conversation
This file contains 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
…sole.debug call This commit updates the Contour rendering settings to a more visually pleasing default configuration with a thinner active outline and a solid fill enabled. It also removes a `console.debug` call in the `removeSegmentationsFromToolGroup` function that is no longer needed.
This commit refactors the `ContourSet` and `IContourSet` interfaces to include a new `getPolyData()` and `setPolyData()` function to get and set the vtk polydata object associated with the contour set for caching purposes. This allows improved performance when repeatedly accessing the polydata. Additionally, optimizations made to `updateContourSets()` ensure better and more consistent rendering of color and visibility updates. There is also cleanup of unused imports and variables.
…specific configs Replace unnecessary loops with reduce function to create an accumulator holding the contour sets and segment specific configs. Then, process the contour sets and apply visibility updates according to any affected segments or custom segment settings that have a fillAlpha attribute.
This commit removes redundant code that has been replaced with simpler alternatives for adding contour sets to an element and updating contours sets in Contour display tools.
This commit adds functionality to compute the centroid of a contour set. The centroid is calculated as a weighted average of all the contour points. Limitations are noted in the code. A new public function, `getCentroid()`, has also been added to retrieve the centroid.
Instead of calculating the centroid of all points in a ContourSet, this restructured logic picks the point closest to the centroid, as the centroid calculation can sometimes cause contours to be rendered incorrectly or not at all. Removed unused import vtkAppendPolyData. fix: increase outline width of active contours This change increases the outline width of active contours from 1 to 2 in contourConfig, for better visibility.
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
jbocce
approved these changes
Apr 5, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @sedghi. Minor docs changes. Approved.
jbocce
approved these changes
Apr 5, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved...again 😊
sedghi
changed the title
feat(contour): improved performance and better configuratoin
feat(contour): improved performance and better configuration
Apr 5, 2023
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.
Improved performance for updating contours and centroid calculations
To test: run https://deploy-preview-543--cornerstone-3d-docs.netlify.app/live-examples/contourrenderingconfiguration