Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Aug 30, 2023

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

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

@netlify
Copy link

netlify bot commented Aug 30, 2023

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 3b7c038
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/64f74eb03c5afe0008cac488
😎 Deploy Preview https://deploy-preview-762--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sedghi sedghi requested a review from jbocce August 30, 2023 17:55
@sedghi sedghi changed the title fix/segmentation ohif feat(brush): update data only once when Brush interaction is done Aug 30, 2023
Copy link
Contributor

@jbocce jbocce left a 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.

@sedghi sedghi requested a review from jbocce September 1, 2023 14:10
// 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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*needs

Copy link
Contributor

@jbocce jbocce left a 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.

@sedghi
Copy link
Member Author

sedghi commented Sep 5, 2023

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

@sedghi sedghi closed this Sep 5, 2023
@sedghi
Copy link
Member Author

sedghi commented Feb 2, 2024

Re-opening since we need this for the history API, and we have a good web worker api right now to put stuff there

@sedghi sedghi reopened this Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants