-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(contour): improved performance and better configuration (#543)
* refactor: Update contour rendering default configuration & remove console.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. * perf: Optimize getting and setting vtk polydata for contour sets 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. * refactor(displayTools): optimize contour sets rendering with segment 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. * wip * refactor: Remove redundant code for Contour display tools 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. * feat: add computation for centroid of the contour set 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. * refactor: simplify centroid calculation for better contour rendering 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. * update api * update api * apply review comments
- Loading branch information
Showing
13 changed files
with
193 additions
and
53 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.