Skip to content

Instance segmentation - #71

Open
quasar1357 wants to merge 4 commits into
guiwitz:mainfrom
hinderling:instance-seg
Open

Instance segmentation#71
quasar1357 wants to merge 4 commits into
guiwitz:mainfrom
hinderling:instance-seg

Conversation

@quasar1357

Copy link
Copy Markdown
Collaborator

This pull request adds support for generating and displaying instance masks in the napari ConvPaint plugin, alongside existing segmentation and probability outputs. It introduces new UI controls for instance mask generation, allows users to specify a minimum instance size, and ensures proper layer management for these outputs. The changes span both backend logic and the user interface, providing a more complete and flexible workflow for users who need instance-level segmentation.

Instance mask support and UI enhancements:

  • Added a get_instances method to convpaint_model.py to generate instance masks from semantic segmentations, with options for minimum size and class selection.
  • Updated the widget UI to include a checkbox for adding instance masks, a field for minimum instance size, and tooltips for these new controls. [1] [2]
  • Connected new UI elements to internal state, ensuring that instance mask generation is triggered when requested, and that user input is correctly parsed and stored. [1] [2] [3] [4] [5]

Prediction and output logic:

  • Modified prediction routines to generate and add instance masks to the viewer when requested, both for single-frame and batch predictions, including correct handling of layer creation and data assignment. [1] [2] [3] [4] [5]
  • Ensured that changes in input selection or channel mode correctly reset the state for instance mask outputs, mirroring the handling of segmentation and probability outputs. [1] [2]

Layer management improvements:

  • Added logic to create, reset, and backup instance mask layers in the viewer, including unique naming to prevent overwriting existing layers. [1] [2]
  • Updated reset and tooltip removal routines to handle the new instance mask controls and state. [1] [2]

Minor UI/UX improvements:

  • Clarified the label for the class distribution button for better user understanding.

These changes collectively provide users with the ability to generate and visualize instance masks, enhancing the segmentation capabilities of the plugin.

@codecov-commenter

codecov-commenter commented Jun 26, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 27.33333% with 109 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.43%. Comparing base (b1e1ddd) to head (b2ebc14).

Files with missing lines Patch % Lines
src/napari_convpaint/convpaint_widget.py 40.86% 55 Missing ⚠️
src/napari_convpaint/utils.py 3.70% 52 Missing ⚠️
src/napari_convpaint/convpaint_model.py 33.33% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #71      +/-   ##
==========================================
- Coverage   63.20%   62.43%   -0.77%     
==========================================
  Files          32       32              
  Lines        6515     6656     +141     
==========================================
+ Hits         4118     4156      +38     
- Misses       2397     2500     +103     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@quasar1357 quasar1357 closed this Jul 3, 2026
@quasar1357
quasar1357 deleted the instance-seg branch July 3, 2026 10:42
@quasar1357 quasar1357 reopened this Jul 3, 2026
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.

2 participants