Skip to content

Object classifier class selection panel - #1391

Merged
anwai98 merged 5 commits into
computational-cell-analytics:devfrom
titusgriebel:classifier-class-panel
Oct 19, 2026
Merged

anwai98 merged 5 commits into
computational-cell-analytics:devfrom
titusgriebel:classifier-class-panel

Conversation

@titusgriebel

@titusgriebel titusgriebel commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

@anwai98

Replace the label-name list with one row per class: id, a button that selects the class for painting, a color swatch, a remove button and an optional name. "Add Class" adds the next free id. A label id that is painted, restored for a revisited image or selected in the napari layer controls gets a row. The color applies to the annotations layer. The remove button erases the class in the current image and refuses when other images of a batch still use it.

I have been experimenting with this function for some weeks and from my experience, it significantly improves annotation efficiency without adding unnecessary complexity to the GUI.

titusgriebel and others added 2 commits October 16, 2026 14:08
Replace the label-name list with one row per class: id, a radio button
that selects the class for painting, a color swatch, a remove button and
an optional name. "Add Class" adds the next free id. A label id that is
painted, restored for a revisited image or selected in the napari layer
controls gets a row. The color applies to the annotations and the
prediction. The remove button erases the class in the current image and
refuses when other images of a batch still use it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fix two comments that did not match the code: the order of the row
widgets and the class that is selected after a removal. Rewrite the other
comments as complete sentences with clear references.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@anwai98

anwai98 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Nice, thanks @titusgriebel. Lemme come back to you later today! (I'll give it a closer review in some)

@anwai98 anwai98 self-assigned this Oct 16, 2026
@constantinpape
constantinpape self-requested a review October 16, 2026 15:39
@constantinpape

Copy link
Copy Markdown
Contributor

fyi: I think the idea is good but I will probably have some feedback. Will also review it later.

@constantinpape constantinpape left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The functionality is amazing! This makes both object classification and pixel classification much more user-friendly.

There's a few minor points claude found that could or should still be addressed:

  1. The class colors replace napari's colormap. The layers now always use a DirectLabelColormap, so napari's "shuffle colors" and colormap controls stop doing anything on these layers. This is ok, but would be good to explicitly state in the docs or tooltip.
  2. Cleanups: The TODO at https://github.com/computational-cell-analytics/micro-sam/blob/dev/micro_sam/sam_annotator/object_classifier.py#L86-L87 can be removed.
  3. Now redundant function call, see in-line comment.

Comment thread micro_sam/sam_annotator/_annotator.py Outdated

@anwai98 anwai98 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the great addition @titusgriebel (looks great to me).

I took care of the suggestions from CP and pushed them directly to the PR.

Gonna merge this once the CIs pass!

@anwai98
anwai98 merged commit 207fcdd into computational-cell-analytics:dev Oct 19, 2026
3 of 4 checks passed
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