-
Notifications
You must be signed in to change notification settings - Fork 298
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(brush): update data only once when Brush interaction is done #762
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Just some minor comments. Thanks.
// calculation allows us to only modify the segmentation scalar data once the | ||
// user has finished drawing the circle or sphere. This is done by splitting | ||
// the points into chunks and only triggering the segmentation data modified | ||
// event once all the points have been processed. The tool need to provide the points |
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.
*needs
// calculation allows us to only modify the segmentation scalar data once the | ||
// user has finished drawing the circle or sphere. This is done by splitting | ||
// the points into chunks and only triggering the segmentation data modified | ||
// event once all the points have been processed. The tool need to provide the points |
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.
*needs
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.
Just minor doc update.
I'm closing this for now (continuing here #771) The reason is that there will be a sever performance drop for the sphere tool (as we are filling inside all spheres one by one, and that blocks the UI and has bad user experience) I guess for the historyAPI we should tag each data modified with an id of the transaction. Or we should take a look at how to capture the convex hull of set of spheres, which I won't do for now |
Re-opening since we need this for the history API, and we have a good web worker api right now to put stuff there |
Context
Segmentation Export
Make the generateSegmentation function to return the segmentation dataset instead of the arraybuffer since one might need to push it to the server
Brush Tool
Previously the brush tool modifications/interaction were updating the scalarData and triggering the segmentaion_data_modified A LOT, which is not performance optimized and later when we add the history undo/redo we will end up with problems (since each transaction should be undo/redoable not the whole drag). This PR will show an intermediate step showing the brush locations (similar to volview and 3D Slicer) and when the mouse up happens it does the scalar data update, we call this
lazyCalculation
Brush Tool size
Previously the brush tool size was in canvas, which means that when you zoomed in the image the brush size would become smaller which is unexpected by the user. This PR changes it to the world coordinates in mm units
Before
CleanShot.2023-08-30.at.13.52.24.mp4
Now
CleanShot.2023-08-30.at.13.54.47.mp4
Testing
Test it in the labelmapsegmentationtools example
https://deploy-preview-762--cornerstone-3d-docs.netlify.app/live-examples/labelmapsegmentationtools
Checklist
PR
semantic-release format and guidelines.
Code
[] My code has been well-documented (function documentation, inline comments,
etc.)
[] 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