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: Add option to calculate Measurement per Mask component #590

Merged
merged 20 commits into from
Apr 26, 2022

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented Apr 21, 2022

This PR adds the option to calculate Measurement Per each mask component.

Zrzut ekranu z 2022-04-21 22-08-06

@Czaki Czaki added this to the 0.14.1 milestone Apr 21, 2022
@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #590 (034b55b) into develop (d519d3a) will increase coverage by 0.48%.
The diff coverage is 88.05%.

@@             Coverage Diff             @@
##           develop     #590      +/-   ##
===========================================
+ Coverage    80.59%   81.07%   +0.48%     
===========================================
  Files          143      143              
  Lines        19130    19148      +18     
===========================================
+ Hits         15417    15525     +108     
+ Misses        3713     3623      -90     
Impacted Files Coverage Δ
...ckage/PartSeg/_roi_analysis/prepare_plan_widget.py 90.33% <25.00%> (ø)
package/PartSeg/_roi_analysis/advanced_window.py 65.21% <71.42%> (+12.42%) ⬆️
...lugins/napari_widgets/roi_extraction_algorithms.py 93.28% <80.00%> (ø)
package/PartSegCore/utils.py 93.54% <80.00%> (-0.25%) ⬇️
...rtSeg/plugins/napari_widgets/measurement_widget.py 79.27% <90.00%> (+2.21%) ⬆️
package/PartSeg/plugins/napari_widgets/utils.py 91.07% <100.00%> (ø)
package/PartSegCore/analysis/measurement_base.py 90.35% <100.00%> (+1.58%) ⬆️
...ge/PartSegCore/analysis/measurement_calculation.py 97.11% <100.00%> (+0.01%) ⬆️
...Core/analysis/batch_processing/parallel_backend.py 89.40% <0.00%> (-1.99%) ⬇️
... and 1 more

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 d519d3a...034b55b. Read the comment docs.

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

Co-authored-by: Sourcery AI <>
@Czaki Czaki marked this pull request as ready for review April 25, 2022 19:48
@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

1 similar comment
@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Apr 25, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.32%.

Quality metrics Before After Change
Complexity 2.70 ⭐ 2.69 ⭐ -0.01 👍
Method Length 63.17 🙂 64.44 🙂 1.27 👎
Working memory 8.35 🙂 8.40 🙂 0.05 👎
Quality 70.68% 🙂 70.36% 🙂 -0.32% 👎
Other metrics Before After Change
Lines 6931 7119 188
Changed files Quality Before Quality After Quality Change
package/PartSeg/_roi_analysis/advanced_window.py 59.73% 🙂 59.69% 🙂 -0.04% 👎
package/PartSeg/_roi_analysis/prepare_plan_widget.py 71.41% 🙂 71.39% 🙂 -0.02% 👎
package/PartSeg/plugins/napari_widgets/measurement_widget.py 70.23% 🙂 70.32% 🙂 0.09% 👍
package/PartSeg/plugins/napari_widgets/roi_extraction_algorithms.py 72.64% 🙂 72.52% 🙂 -0.12% 👎
package/PartSeg/plugins/napari_widgets/utils.py 84.29% ⭐ 84.52% ⭐ 0.23% 👍
package/PartSegCore/utils.py 81.94% ⭐ 82.05% ⭐ 0.11% 👍
package/PartSegCore/analysis/measurement_base.py 78.72% ⭐ 78.03% ⭐ -0.69% 👎
package/PartSegCore/analysis/measurement_calculation.py 73.48% 🙂 72.44% 🙂 -1.04% 👎
package/tests/test_PartSeg/test_napari_widgets.py 66.85% 🙂 67.44% 🙂 0.59% 👍
package/tests/test_PartSeg/roi_analysis/test_advanced_window.py 73.20% 🙂 72.01% 🙂 -1.19% 👎
package/tests/test_PartSegCore/test_measurements.py 70.84% 🙂 70.35% 🙂 -0.49% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
package/PartSegCore/analysis/measurement_calculation.py MeasurementProfile.calculate_yield 14 🙂 272 ⛔ 19 ⛔ 29.41% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/_roi_analysis/prepare_plan_widget.py PlanPreview.update_view 24 😞 236 ⛔ 13 😞 30.27% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/_roi_analysis/advanced_window.py MultipleInput.__init__ 12 🙂 316 ⛔ 16 ⛔ 32.22% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/_roi_analysis/advanced_window.py MeasurementSettings.__init__ 1 ⭐ 725 ⛔ 26 ⛔ 34.03% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/_roi_analysis/advanced_window.py Properties.__init__ 2 ⭐ 502 ⛔ 19 ⛔ 36.60% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/590

@Czaki Czaki merged commit 6c6ccc4 into develop Apr 26, 2022
@Czaki Czaki deleted the feature/measurement_per_mask_component branch April 26, 2022 07:17
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.

1 participant