bauerdavid / napari-bbox

BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

`layer.as_layer_data_tuple()` fails #11

Closed jplumail closed 8 months ago

jplumail commented 8 months ago

Describe the bug Cannot copy a BoundingBoxLayer.

To Reproduce

from napari.layers import Layer
from napari_bbox.boundingbox import BoundingBoxLayer

layer = BoundingBoxLayer(
    ndim=3,
    edge_color=[0, 0, 255, 255],
    face_color=[0, 0, 0, 0],
)

Layer.create(*layer.as_layer_data_tuple())

Expected behavior I expect a layer to be created.

napari info

napari: 0.4.18
Platform: Linux-5.14.0-1057-oem-x86_64-with-glibc2.37
System: Ubuntu 23.04
Python: 3.11.4 (main, Dec  7 2023, 15:43:41) [GCC 12.3.0]
Qt: 5.15.2
PyQt5: 5.15.10
NumPy: 1.26.3
SciPy: 1.12.0
Dask: 2024.1.0
VisPy: 0.12.2
magicgui: 0.8.1
superqt: 0.6.1
in-n-out: 0.1.9
app-model: 0.2.4
npe2: 0.7.4

OpenGL:
  - GL version:  4.6.0 NVIDIA 530.30.02
  - MAX_TEXTURE_SIZE: 32768

Screens:
  - screen 1: resolution 2560x1440, scale 1.0
  - screen 2: resolution 1920x1200, scale 1.0

Settings path:
  - /home/plumail/.config/napari/dev_1cf4b7c5ede8629d160c1a1e9c092e063260b31a/settings.yaml
Plugins:
  - bfio: 2.3.0 (4 contributions)
  - napari: 0.4.18 (77 contributions)
  - napari-aicsimageio: 0.7.2 (2 contributions)
  - napari-bbox: 0.0.7 (4 contributions)
  - napari-console: 0.0.9 (0 contributions)
  - napari-nD-annotator: 0.2.0 (6 contributions)
  - napari-spfluo: 0.1.dev8+g3e10c5d (10 contributions)
  - napari-svg: 0.1.10 (2 contributions)
  - ome-types: 0.4.3 (2 contributions)