Skip to content

Commit

Permalink
finished first draft of mask qt widget
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Nov 17, 2023
1 parent 2464127 commit 304e8c1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions brainglobe_template_builder/napari/mask_widget.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
from napari.layers import Image
from napari.utils.notifications import show_info
from napari.viewer import Viewer
from qtpy.QtWidgets import (
QComboBox,
Expand Down Expand Up @@ -44,13 +45,13 @@ def _on_button_click(self):
"""Generate a mask from the selected image layer."""

if len(self.viewer.layers.selection) != 1:
print("Please select exactly one image layer")
show_info("Please select exactly one image layer")
return None
else:
image = list(self.viewer.layers.selection)[0]

image = self.viewer.layers.selection[0]

if not isinstance(image, Image):
print("The selected layer is not an image layer")
show_info("The selected layer is not an image layer")
return None

# Get parameters from widgets
Expand Down

0 comments on commit 304e8c1

Please sign in to comment.