Skip to content

Commit 6bb71bb

Browse files
committed
Fix shape label update
1 parent 41e3da7 commit 6bb71bb

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

napari_cellseg3d/interface.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,6 @@ def __init__(
757757
):
758758
super().__init__(parent=parent, fixed=False)
759759
self._viewer = viewer
760-
761-
self.image = None
762760
self.layer_type = layer_type
763761

764762
self.layer_list = DropdownMenu(
@@ -789,11 +787,14 @@ def _update_tooltip(self):
789787
self.layer_list.setToolTip(self.layer_list.currentText())
790788

791789
def _update_description(self):
792-
if self.layer_list.currentText() != "":
793-
self.layer_description.setVisible(True)
794-
shape_desc = f"Shape : {self.layer_data().shape}"
795-
self.layer_description.setText(shape_desc)
796-
else:
790+
try:
791+
if self.layer_list.currentText() != "":
792+
self.layer_description.setVisible(True)
793+
shape_desc = f"Shape : {self.layer_data().shape}"
794+
self.layer_description.setText(shape_desc)
795+
else:
796+
self.layer_description.setVisible(False)
797+
except KeyError:
797798
self.layer_description.setVisible(False)
798799

799800
def _add_layer(self, event):

0 commit comments

Comments
 (0)