diff --git a/napari_skimage_regionprops/_table.py b/napari_skimage_regionprops/_table.py index 1c62ead..6ca93b8 100644 --- a/napari_skimage_regionprops/_table.py +++ b/napari_skimage_regionprops/_table.py @@ -34,12 +34,16 @@ def __init__(self, layer: "napari.layers.Layer", viewer: "napari.Viewer" = None) # Check if features and properties are already defined if not hasattr(layer, "features"): layer.features = {} + else: + # Mirror properties to features + layer.properties = layer.features.to_dict(orient="list") if not hasattr(layer, "properties"): layer.properties = {} + else: + # Mirror features to properties + layer.features = pd.DataFrame(layer.properties) if hasattr(layer, "properties"): self.set_content(layer.properties) - elif hasattr(layer, "features"): - self.set_content(layer.features.to_dict(orient="list")) else: self.set_content({})