Skip to content

Commit

Permalink
Fix handling layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallory Wittwer committed Aug 26, 2024
1 parent abe092d commit 1851395
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/napari_label_focus/_widget.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import napari
import napari.layers
import napari.layers.labels
import numpy as np
import pandas as pd
import skimage.measure
Expand Down Expand Up @@ -53,7 +54,7 @@ def _on_layer_selection_changed(self, event):
else:
selected_layer = event.source.active

if self.selected_labels_layer is not None:
if isinstance(self.selected_labels_layer, napari.layers.Labels):
self.selected_labels_layer.events.paint.disconnect(self.update_table_content)
self.selected_labels_layer.events.data.disconnect(self.update_table_content)
if self.selected_labels_layer.data.ndim == 4:
Expand Down Expand Up @@ -186,7 +187,7 @@ def handle_time_axis_changed(self, event):
self.handle_selected_table_label_changed(current_selected_label)

def update_table_content(self):
if self.selected_labels_layer is None:
if not isinstance(self.selected_labels_layer, napari.layers.Labels):
self._table.clear()
self._table.setRowCount(1)
self._table.setColumnWidth(0, 30)
Expand Down

0 comments on commit 1851395

Please sign in to comment.