Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jluethi committed Jul 19, 2024
2 parents 2283ce8 + 8a4c984 commit 6e2d6db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/napari_ome_zarr_navigator/img_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(self, viewer: "napari.viewer.Viewer"):
self.btn_load_roi = PushButton(text="Load ROI", enabled=False)
self.roi_loader = None
self.roi_widget = None
self.filter_widget = None

super().__init__(
widgets=[
Expand Down Expand Up @@ -89,6 +90,12 @@ def initialize_filters(self):
],
layout="vertical",
)
if self.filter_widget:
with suppress(RuntimeError):
self.viewer.window.remove_dock_widget(
self.filter_widget
)

self.filter_widget = self.viewer.window.add_dock_widget(
widget=self.filters,
name="Filters",
Expand Down
4 changes: 2 additions & 2 deletions src/napari_ome_zarr_navigator/roi_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,15 @@ def find_matching_label_layer(self, table_name):
try:
target_label_name = table_attrs["region"]["path"].split("/")[-1]
except KeyError:
target_label_name = list(self.label_layers.keys)[0]
target_label_name = list(self.label_layers.keys())[0]
logger.info(
f"Table {table_name} did not have region metadata to match"
"it to the correct label image. Attaching the features to the"
f"first selected label layer ({target_label_name})"
)

if target_label_name not in self.label_layers:
target_label_name = list(self.label_layers.keys)[0]
target_label_name = list(self.label_layers.keys())[0]
logger.info(
f"The label {target_label_name} that {table_name} would be "
"matched to where not loaded. Attaching the features to the"
Expand Down

0 comments on commit 6e2d6db

Please sign in to comment.