Skip to content

Commit

Permalink
Image Segmenter: Add invert mask keyboard shortcut: 'i'
Browse files Browse the repository at this point in the history
  • Loading branch information
sitic committed Feb 4, 2025
1 parent dc6df39 commit b5df67a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions optimap/image/_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def interactive_mask(image, initial_mask=None, default_tool="draw", cmap="gray",
``e`` Erase mode
``d`` Draw/Lasso mode
``v`` Toggle mask visibility
``i`` Invert mask
``q`` Quit
========================= ===========================
Expand Down
3 changes: 3 additions & 0 deletions optimap/image/_segmenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__( # type: ignore
``e`` Erase mode
``d`` Draw/Lasso mode
``v`` Toggle mask visibility
``i`` Invert mask
``q`` Quit
========================= ===========================
Expand Down Expand Up @@ -228,6 +229,8 @@ def _on_key_press(self, event):
self._disable_erasing()
elif event.key == "v":
self._toggle_visibility()
elif event.key == "i":
self._inverse_mask()

def _enable_erasing(self, event=None):
self._erasing = True
Expand Down

0 comments on commit b5df67a

Please sign in to comment.