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

feature(brush): add configuration option to skip paint if the segmentation is not visible (skips event calls) #1033

Merged
merged 1 commit into from
Jul 28, 2019

Conversation

dannyrb
Copy link
Member

@dannyrb dannyrb commented Jul 28, 2019

cornerstoneTools.addTool(cornerstoneTools.BrushTool, {
	name: 'Brush',
  configuration: {
	  skipPaintForInvisibleSegmentations: true
  }
})

Tests:

  • cornerstoneTools.store.modules.brush.state.alpha = 0
  • cornerstoneTools.getToolState(element, 'brush').data[segIndex].alpha = 0
  • cornerstoneTools.store.modules.brush.setters.brushVisibilityForElement(enabledElementUID, segIndex, visible)

CC: @JamesAPetts

Other stuff:

  • Shifts duplicate get/set toolState check out of strategies and into BrushTool's _paint method.
  • Provides a way to prevent UX confusion of adding/removing from a segmentation while it's not visible
  • Provides a way to prevent modified/completed events if we're not actually modifying brush data

@codecov
Copy link

codecov bot commented Jul 28, 2019

Codecov Report

Merging #1033 into master will decrease coverage by 0.02%.
The diff coverage is 5.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1033      +/-   ##
==========================================
- Coverage   13.67%   13.65%   -0.03%     
==========================================
  Files         223      223              
  Lines        7398     7409      +11     
  Branches     1199     1200       +1     
==========================================
  Hits         1012     1012              
- Misses       5381     5391      +10     
- Partials     1005     1006       +1
Impacted Files Coverage Δ
src/tools/brush/BrushTool.js 0% <0%> (ø) ⬆️
src/tools/base/BaseBrushTool.js 6.81% <14.28%> (-0.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f1f55d...380a1ac. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jul 28, 2019

Codecov Report

Merging #1033 into master will decrease coverage by 0.02%.
The diff coverage is 5.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1033      +/-   ##
==========================================
- Coverage   13.67%   13.65%   -0.03%     
==========================================
  Files         223      223              
  Lines        7398     7409      +11     
  Branches     1199     1200       +1     
==========================================
  Hits         1012     1012              
- Misses       5381     5391      +10     
- Partials     1005     1006       +1
Impacted Files Coverage Δ
src/tools/brush/BrushTool.js 0% <0%> (ø) ⬆️
src/tools/base/BaseBrushTool.js 6.81% <14.28%> (-0.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f1f55d...380a1ac. Read the comment docs.

@dannyrb dannyrb requested a review from JamesAPetts July 28, 2019 20:02
@dannyrb
Copy link
Member Author

dannyrb commented Jul 28, 2019

I'm going to merge this for now; but please feel free to call out issues/complaints. Ideally, this should not impact consumers by default, as the functionality is hidden by a config flag.

@dannyrb dannyrb merged commit ab4867e into cornerstonejs:master Jul 28, 2019
@dannyrb
Copy link
Member Author

dannyrb commented Jul 28, 2019

🎉 This PR is included in version 3.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant