loicsauteur / napari-annotator

A lightweight plugin extending label layer control.
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

TypeError: arguments did not match any overloaded call #4

Open TAspert opened 1 month ago

TAspert commented 1 month ago

Hello,

Whenever I open napari-annotator and click on a Labels layer, I get this message:

TypeError                                 Traceback (most recent call last)
File ~\anaconda3\envs\napari-env6\lib\site-packages\vispy\app\backends\_qt.py:496, in QtBaseCanvasBackend.mousePressEvent(self=<vispy.app.backends._qt.CanvasBackendDesktop object>, ev=<PyQt5.QtGui.QMouseEvent object>)
    494 if self._vispy_canvas is None:
    495     return
--> 496 self._vispy_mouse_press(
        self = <vispy.app.backends._qt.CanvasBackendDesktop object at 0x000001F599CD80D0>
        ev = <PyQt5.QtGui.QMouseEvent object at 0x000001F5A4274670>
        BUTTONMAP = {0: 0, 1: 1, 2: 2, 4: 3, 8: 4, 16: 5}
    497     native=ev,
    498     pos=_get_event_xy(ev),
    499     button=BUTTONMAP.get(ev.button(), 0),
    500     modifiers=self._modifiers(ev),
    501 )

File ~\anaconda3\envs\napari-env6\lib\site-packages\vispy\app\base.py:184, in BaseCanvasBackend._vispy_mouse_press(self=<vispy.app.backends._qt.CanvasBackendDesktop object>, **kwargs={'button': 1, 'buttons': [], 'last_event': <MouseEvent blocked=False button=1 buttons=[] de...es=[] time=1729259615.6346018 type=mouse_release>, 'last_mouse_press': None, 'modifiers': (), 'native': <PyQt5.QtGui.QMouseEvent object>, 'pos': (112, 187), 'press_event': None})
    181 def _vispy_mouse_press(self, **kwargs):
    182     # default method for delivering mouse press events to the canvas
    183     kwargs.update(self._vispy_mouse_data)
--> 184     ev = self._vispy_canvas.events.mouse_press(**kwargs)
        self._vispy_canvas.events.mouse_press = <vispy.util.event.EventEmitter object at 0x000001F599CCD630>
        kwargs = {'native': <PyQt5.QtGui.QMouseEvent object at 0x000001F5A4274670>, 'pos': (112, 187), 'button': 1, 'modifiers': (), 'buttons': [], 'press_event': None, 'last_event': <MouseEvent blocked=False button=1 buttons=[] delta=[0. 0.] handled=False is_dragging=False last_event=MouseEvent modifiers=() native=<PyQt5.QtGui.QMouseEvent object at 0x000001F5A4274670> pos=[129 190] press_event=None source=None sources=[] time=1729259615.6346018 type=mouse_release>, 'last_mouse_press': None}
        self = <vispy.app.backends._qt.CanvasBackendDesktop object at 0x000001F599CD80D0>
        self._vispy_canvas.events = <vispy.util.event.EmitterGroup object at 0x000001F599CCD570>
        self._vispy_canvas = <NapariSceneCanvas (PyQt5) at 0x1f599cc7550>
    185     if self._vispy_mouse_data['press_event'] is None:
    186         self._vispy_mouse_data['press_event'] = ev

File ~\anaconda3\envs\napari-env6\lib\site-packages\vispy\util\event.py:453, in EventEmitter.__call__(self=<vispy.util.event.EventEmitter object>, *args=(), **kwargs={'button': 1, 'buttons': [], 'last_event': <MouseEvent blocked=False button=1 buttons=[] de...es=[] time=1729259615.6346018 type=mouse_release>, 'last_mouse_press': None, 'modifiers': (), 'native': <PyQt5.QtGui.QMouseEvent object>, 'pos': (112, 187), 'press_event': None})
    450 if self._emitting > 1:
    451     raise RuntimeError('EventEmitter loop detected!')
--> 453 self._invoke_callback(cb, event)
        event = <MouseEvent blocked=False button=1 buttons=[1] delta=[0. 0.] handled=False is_dragging=False last_event=MouseEvent modifiers=() native=<PyQt5.QtGui.QMouseEvent object at 0x000001F5A4274670> pos=[112 187] press_event=None source=None sources=[] time=1729259615.6349907 type=mouse_press>
        self = <vispy.util.event.EventEmitter object at 0x000001F599CCD630>
        cb = <bound method VispyCanvas._on_mouse_press of <napari._vispy.canvas.VispyCanvas object at 0x000001F599CC73A0>>
    454 if event.blocked:
    455     break

File ~\anaconda3\envs\napari-env6\lib\site-packages\vispy\util\event.py:471, in EventEmitter._invoke_callback(self=<vispy.util.event.EventEmitter object>, cb=<bound method VispyCanvas._on_mouse_press of <napari._vispy.canvas.VispyCanvas object>>, event=<MouseEvent blocked=False button=1 buttons=[1] d...rces=[] time=1729259615.6349907 type=mouse_press>)
    469     cb(event)
    470 except Exception:
--> 471     _handle_exception(self.ignore_callback_errors,
        self = <vispy.util.event.EventEmitter object at 0x000001F599CCD630>
        cb = <bound method VispyCanvas._on_mouse_press of <napari._vispy.canvas.VispyCanvas object at 0x000001F599CC73A0>>
        event = <MouseEvent blocked=False button=1 buttons=[1] delta=[0. 0.] handled=False is_dragging=False last_event=MouseEvent modifiers=() native=<PyQt5.QtGui.QMouseEvent object at 0x000001F5A4274670> pos=[112 187] press_event=None source=None sources=[] time=1729259615.6349907 type=mouse_press>
        (cb, event) = (<bound method VispyCanvas._on_mouse_press of <napari._vispy.canvas.VispyCanvas object at 0x000001F599CC73A0>>, <MouseEvent blocked=False button=1 buttons=[1] delta=[0. 0.] handled=False is_dragging=False last_event=MouseEvent modifiers=() native=<PyQt5.QtGui.QMouseEvent object at 0x000001F5A4274670> pos=[112 187] press_event=None source=None sources=[] time=1729259615.6349907 type=mouse_press>)
    472                       self.print_callback_errors,
    473                       self, cb_event=(cb, event))

File ~\anaconda3\envs\napari-env6\lib\site-packages\vispy\util\event.py:469, in EventEmitter._invoke_callback(self=<vispy.util.event.EventEmitter object>, cb=<bound method VispyCanvas._on_mouse_press of <napari._vispy.canvas.VispyCanvas object>>, event=<MouseEvent blocked=False button=1 buttons=[1] d...rces=[] time=1729259615.6349907 type=mouse_press>)
    467 def _invoke_callback(self, cb, event):
    468     try:
--> 469         cb(event)
        cb = <bound method VispyCanvas._on_mouse_press of <napari._vispy.canvas.VispyCanvas object at 0x000001F599CC73A0>>
        event = <MouseEvent blocked=False button=1 buttons=[1] delta=[0. 0.] handled=False is_dragging=False last_event=MouseEvent modifiers=() native=<PyQt5.QtGui.QMouseEvent object at 0x000001F5A4274670> pos=[112 187] press_event=None source=None sources=[] time=1729259615.6349907 type=mouse_press>
    470     except Exception:
    471         _handle_exception(self.ignore_callback_errors,
    472                           self.print_callback_errors,
    473                           self, cb_event=(cb, event))

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\_vispy\canvas.py:470, in VispyCanvas._on_mouse_press(self=<napari._vispy.canvas.VispyCanvas object>, event=<MouseEvent blocked=False button=1 buttons=[1] d...rces=[] time=1729259615.6349907 type=mouse_press>)
    458 def _on_mouse_press(self, event: MouseEvent) -> None:
    459     """Called whenever mouse pressed in canvas.
    460
    461     Parameters
   (...)
    468     None
    469     """
--> 470     self._process_mouse_event(mouse_press_callbacks, event)
        event = <MouseEvent blocked=False button=1 buttons=[1] delta=[0. 0.] handled=False is_dragging=False last_event=MouseEvent modifiers=() native=<PyQt5.QtGui.QMouseEvent object at 0x000001F5A4274670> pos=[112 187] press_event=None source=None sources=[] time=1729259615.6349907 type=mouse_press>
        self = <napari._vispy.canvas.VispyCanvas object at 0x000001F599CC73A0>

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\_vispy\canvas.py:417, in VispyCanvas._process_mouse_event(self=<napari._vispy.canvas.VispyCanvas object>, mouse_callbacks=<function mouse_press_callbacks>, event=<ReadOnlyWrapper at 0x000001F5A6148B00 for MouseEvent>)
    415 layer = self.viewer.layers.selection.active
    416 if layer is not None:
--> 417     mouse_callbacks(layer, event)
        event = <ReadOnlyWrapper at 0x000001F5A6148B00 for MouseEvent at 0x000001F5A5A544F0>
        layer = <Labels layer 'Labels' at 0x1f5a20cc4f0>
        mouse_callbacks = <function mouse_press_callbacks at 0x000001F594EB37F0>

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\utils\interactions.py:129, in mouse_press_callbacks(obj=<Labels layer 'Labels'>, event=<ReadOnlyWrapper at 0x000001F5A6148B00 for MouseEvent>)
    127 if inspect.isgenerator(gen):
    128     try:
--> 129         next(gen)
        gen = <generator object draw at 0x000001F5A2118CF0>
    130         # now store iterated generator
    131         obj._mouse_drag_gen[mouse_drag_func] = gen

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\layers\labels\_labels_mouse_bindings.py:38, in draw(layer=<Labels layer 'Labels'>, event=<ReadOnlyWrapper at 0x000001F5A6148B00 for MouseEvent>)
     36 # on press
     37 with layer.block_history():
---> 38     layer._draw(new_label, coordinates, coordinates)
        coordinates = array([90.48293, 78.28956])
        layer = <Labels layer 'Labels' at 0x1f5a20cc4f0>
        new_label = 1
     39     yield
     41     last_cursor_coord = coordinates

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\layers\labels\labels.py:1189, in Labels._draw(self=<Labels layer 'Labels'>, new_label=1, last_cursor_coord=array([90.48293, 78.28956]), coordinates=array([90.48293, 78.28956]))
   1187     elif self._mode == Mode.FILL:
   1188         self.fill(c, new_label, refresh=False)
-> 1189 self._partial_labels_refresh()
        self = <Labels layer 'Labels' at 0x1f5a20cc4f0>

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\layers\labels\labels.py:852, in Labels._partial_labels_refresh(self=<Labels layer 'Labels'>)
    844 # The next line is needed to make the following tests pass in
    845 # napari/_vispy/_tests/:
    846 # - test_vispy_labels_layer.py::test_labels_painting
    847 # - test_vispy_labels_layer.py::test_labels_fill_slice
    848 # See https://github.com/napari/napari/pull/6112/files#r1291613760
    849 # and https://github.com/napari/napari/issues/6185
    850 self._slice.image.view[updated_slice] = colors_sliced
--> 852 self.events.labels_update(data=colors_sliced, offset=offset)
        offset = [np.int64(81), np.int64(73)]
        colors_sliced = array([[0, 0, ..., 0, 0],
       [0, 0, ..., 0, 0],
       ...,
       [0, 0, ..., 0, 0],
       [0, 0, ..., 0, 0]], dtype=uint8)
        self.events.labels_update = <napari.utils.events.event.EventEmitter object at 0x000001F5A3FB24D0>
        self = <Labels layer 'Labels' at 0x1f5a20cc4f0>
        self.events = <napari.utils.events.event.EmitterGroup object at 0x000001F5A3E5E350>
    853 self._updated_slice = None

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\utils\events\event.py:764, in EventEmitter.__call__(self=<napari.utils.events.event.EventEmitter object>, *args=(), **kwargs={'data': array([[0, 0, ..., 0, 0],
       [0, 0, ..., 0, ...., 0, 0],
       [0, 0, ..., 0, 0]], dtype=uint8), 'offset': [np.int64(81), np.int64(73)]})
    761     self._block_counter.update([cb])
    762     continue
--> 764 self._invoke_callback(cb, event if pass_event else None)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>
        self = <napari.utils.events.event.EventEmitter object at 0x000001F5A3FB24D0>
        cb = <napari.utils.events.event.EmitterGroup object at 0x000001F5A3E5E350>
        pass_event = True
    765 if event.blocked:
    766     break

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\utils\events\event.py:802, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<napari.utils.events.event.EmitterGroup object>, event=<Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>)
    800     self.disconnect(cb)
    801     return
--> 802 _handle_exception(
        self = <napari.utils.events.event.EventEmitter object at 0x000001F5A3FB24D0>
        event = <Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>
        cb = <napari.utils.events.event.EmitterGroup object at 0x000001F5A3E5E350>
        (cb, event) = (<napari.utils.events.event.EmitterGroup object at 0x000001F5A3E5E350>, <Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>)
    803     self.ignore_callback_errors,
    804     self.print_callback_errors,
    805     self,
    806     cb_event=(cb, event),
    807 )

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\utils\events\event.py:789, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EventEmitter object>, cb=<napari.utils.events.event.EmitterGroup object>, event=<Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>)
    787 try:
    788     if event is not None:
--> 789         cb(event)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>
        cb = <napari.utils.events.event.EmitterGroup object at 0x000001F5A3E5E350>
    790     else:
    791         cb()

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\utils\events\event.py:764, in EventEmitter.__call__(self=<napari.utils.events.event.EmitterGroup object>, *args=(<Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>,), **kwargs={})
    761     self._block_counter.update([cb])
    762     continue
--> 764 self._invoke_callback(cb, event if pass_event else None)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>
        self = <napari.utils.events.event.EmitterGroup object at 0x000001F5A3E5E350>
        cb = <function Annotator.__init__.<locals>.update_selected_layer.<locals>.notify_change_in_Labels_layer at 0x000001F5A4274550>
        pass_event = True
    765 if event.blocked:
    766     break

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\utils\events\event.py:802, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EmitterGroup object>, cb=<function Annotator.__init__.<locals>.update_selected_layer.<locals>.notify_change_in_Labels_layer>, event=<Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>)
    800     self.disconnect(cb)
    801     return
--> 802 _handle_exception(
        self = <napari.utils.events.event.EmitterGroup object at 0x000001F5A3E5E350>
        event = <Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>
        cb = <function Annotator.__init__.<locals>.update_selected_layer.<locals>.notify_change_in_Labels_layer at 0x000001F5A4274550>
        (cb, event) = (<function Annotator.__init__.<locals>.update_selected_layer.<locals>.notify_change_in_Labels_layer at 0x000001F5A4274550>, <Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>)
    803     self.ignore_callback_errors,
    804     self.print_callback_errors,
    805     self,
    806     cb_event=(cb, event),
    807 )

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari\utils\events\event.py:789, in EventEmitter._invoke_callback(self=<napari.utils.events.event.EmitterGroup object>, cb=<function Annotator.__init__.<locals>.update_selected_layer.<locals>.notify_change_in_Labels_layer>, event=<Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>)
    787 try:
    788     if event is not None:
--> 789         cb(event)
        event = <Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>
        cb = <function Annotator.__init__.<locals>.update_selected_layer.<locals>.notify_change_in_Labels_layer at 0x000001F5A4274550>
    790     else:
    791         cb()

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari_annotator\_dock_widget.py:75, in Annotator.__init__.<locals>.update_selected_layer.<locals>.notify_change_in_Labels_layer(event=<Event blocked=False handled=False native=None source=None sources=[] type='labels_update'>)
     66 @self.selected_Layer.events.connect
     67 def notify_change_in_Labels_layer(event):
     68     """
     69     Connecting the labels layer to events done on the layer,
     70     in case the plugin was started on a non-labels layer.
   (...)
     73     :return:
     74     """
---> 75     self.upon_change_in_Labels_layer()
        self = <napari_annotator._dock_widget.Annotator object at 0x000001F5A20B8550>

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari_annotator\_dock_widget.py:122, in Annotator.upon_change_in_Labels_layer(self=<napari_annotator._dock_widget.Annotator object>)
    115 """
    116 Method to run actions upon change-catches on the current labels layer
    117 :return:
    118 """
    119 # print("-------   Notification:  event in selected label layer!")
    120
    121 # update the widget label list for new entries
--> 122 self.widget_label_main.update_label_entries()
        self.widget_label_main = <napari_annotator._annotations_list_widget.AnnoList object at 0x000001F5A20B83A0>
        self = <napari_annotator._dock_widget.Annotator object at 0x000001F5A20B8550>
    124 # mark/select the currently selected label
    125 self.widget_label_main.get_selected_label()

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari_annotator\_annotations_list_widget.py:106, in AnnoList.update_label_entries(self=<napari_annotator._annotations_list_widget.AnnoList object>)
    102 if nItems < maxLabels:
    103     # make sure that it works for if several labels were added at once
    104     for i in range(nItems, maxLabels):
    105         # create a new label item (lItm)
--> 106         lItm = LabelItem(nItems + 1, self.labelLayer, self.color_dict)
        nItems = 0
        self = <napari_annotator._annotations_list_widget.AnnoList object at 0x000001F5A20B83A0>
        self.labelLayer = <Labels layer 'Labels' at 0x1f5a20cc4f0>
        nItems + 1 = 1
        self.color_dict = {0: ColorArray([0.48627, 0.4549 , 0.5098 , 1.     ], dtype=float32), 1: ColorArray([0.27843, 0.25882, 0.3451 , 1.     ], dtype=float32), 2: ColorArray([0.10196, 0.16078, 0.15294, 1.     ], dtype=float32), 3: ColorArray([0.18824, 0.9451 , 0.1098 , 1.     ], dtype=float32), 4: ColorArray([0.98039, 0.91765, 0.80392, 1.     ], dtype=float32), 5: ColorArray([0.91373, 0.80784, 0.33725, 1.     ], dtype=float32), 6: ColorArray([0.97255, 0.82745, 0.51373, 1.     ], dtype=float32), 7: ColorArray([0.54118, 0.87843, 0.12157, 1.     ], dtype=float32), 8: ColorArray([0.37255, 0.69412, 0.71373, 1.     ], dtype=float32), 9: ColorArray([0.70588, 0.77255, 0.24314, 1.     ], dtype=float32), 10: ColorArray([0.97255, 0.92941, 0.43137, 1.     ], dtype=float32), 11: ColorArray([0.87059, 0.98039, 0.16471, 1.     ], dtype=float32), 12: ColorArray([0.43137, 0.77255, 0.97647, 1.     ], dtype=float32), 13: ColorArray([0.67843, 0.47451, 0.59216, 1.     ], dtype=float32), 14: ColorArray([0.70588, 0.4902 , 0.74118, 1.     ], dtype=float32), 15: ColorArray([0.15686, 0.56863, 0.13333, 1.     ], dtype=float32), 16: ColorArray([0.23529, 0.59216, 0.3098 , 1.     ], dtype=float32), 17: ColorArray([0.37647, 0.47843, 0.20392, 1.     ], dtype=float32), 18: ColorArray([0.17255, 0.94118, 0.58039, 1.     ], dtype=float32), 19: ColorArray([0.67059, 0.64314, 0.52549, 1.     ], dtype=float32), 20: ColorArray([0.14902, 0.67843, 0.22745, 1.     ], dtype=float32), 21: ColorArray([0.29804, 0.21176, 0.48235, 1.     ], dtype=float32), 22: ColorArray([0.     , 0.17255, 0.92157, 1.     ], dtype=float32), 23: ColorArray([0.07843, 0.14118, 0.40784, 1.     ], dtype=float32), 24: ColorArray([0.10196, 0.18039, 0.27451, 1.     ], dtype=float32), 25: ColorArray([0.11373, 0.79216, 0.31765, 1.     ], dtype=float32), 26: ColorArray([0.33725, 0.31765, 0.57647, 1.     ], dtype=float32), 27: ColorArray([0.48235, 0.55686, 0.05882, 1.     ], dtype=float32), 28: ColorArray([0.85882, 0.5098 , 0.34902, 1.     ], dtype=float32), 29: ColorArray([0.87843, 0.33725, 0.24706, 1.     ], dtype=float32), 30: ColorArray([0.93725, 0.33725, 0.39608, 1.     ], dtype=float32), 31: ColorArray([0.61569, 0.47843, 0.07451, 1.     ], dtype=float32), 32: ColorArray([0.33725, 0.47059, 0.52549, 1.     ], dtype=float32), 33: ColorArray([0.11765, 0.35294, 0.3098 , 1.     ], dtype=float32), 34: ColorArray([0.68627, 0.87059, 0.04314, 1.     ], dtype=float32), 35: ColorArray([0.29412, 0.11765, 0.12549, 1.     ], dtype=float32), 36: ColorArray([0.59608, 0.11373, 0.54902, 1.     ], dtype=float32), 37: ColorArray([0.61569, 0.1098 , 0.69412, 1.     ], dtype=float32), 38: ColorArray([0.09412, 0.45882, 0.39608, 1.     ], dtype=float32), 39: ColorArray([0.30588, 0.21176, 0.06275, 1.     ], dtype=float32), 40: ColorArray([0.86275, 0.36471, 0.88235, 1.     ], dtype=float32), 41: ColorArray([0.55294, 0.49804, 0.60784, 1.     ], dtype=float32), 42: ColorArray([0.60392, 0.17255, 0.25882, 1.     ], dtype=float32), 43: ColorArray([0.65098, 0.36863, 0.64314, 1.     ], dtype=float32), 44: ColorArray([0.15294, 0.46275, 0.01961, 1.     ], dtype=float32), 45: ColorArray([0.9451 , 0.28627, 0.71373, 1.     ], dtype=float32), 46: ColorArray([0.59608, 0.61569, 0.70196, 1.     ], dtype=float32), 47: ColorArray([0.56863, 0.5098 , 0.28627, 1.     ], dtype=float32), 48: ColorArray([0.61961, 0.52941, 0.43529, 1.     ], dtype=float32), 49: ColorArray([0.09804, 0.23922, 0.49804, 1.     ], dtype=float32), 50: ColorArray([0.2549 , 0.09804, 0.39216, 1.     ], dtype=float32), 51: ColorArray([0.79216, 0.90196, 0.87843, 1.     ], dtype=float32), 52: ColorArray([0.7451 , 0.43137, 0.42745, 1.     ], dtype=float32), 53: ColorArray([0.08235, 0.0902 , 0.19216, 1.     ], dtype=float32), 54: ColorArray([0.2902 , 0.1451 , 0.62353, 1.     ], dtype=float32), 55: ColorArray([0.85098, 0.84314, 0.53333, 1.     ], dtype=float32), 56: ColorArray([0.27843, 0.22745, 0.62353, 1.     ], dtype=float32), 57: ColorArray([0.43137, 0.9098 , 0.38824, 1.     ], dtype=float32), 58: ColorArray([0.57255, 0.78431, 0.27059, 1.     ], dtype=float32), 59: ColorArray([0.33333, 0.26667, 0.72549, 1.     ], dtype=float32), 60: ColorArray([0.4    , 0.15686, 0.33333, 1.     ], dtype=float32), 61: ColorArray([0.42353, 0.16471, 0.47059, 1.     ], dtype=float32), 62: ColorArray([0.73725, 0.70588, 0.26667, 1.     ], dtype=float32), 63: ColorArray([0.67843, 0.28627, 0.79216, 1.     ], dtype=float32), 64: ColorArray([0.01176, 0.30588, 0.22353, 1.     ], dtype=float32), 65: ColorArray([0.4549 , 0.27451, 0.42353, 1.     ], dtype=float32), 66: ColorArray([0.22745, 0.48235, 0.22353, 1.     ], dtype=float32), 67: ColorArray([0.97255, 0.03529, 0.24706, 1.     ], dtype=float32), 68: ColorArray([0.37647, 0.81176, 0.81569, 1.     ], dtype=float32), 69: ColorArray([0.18039, 0.27843, 0.06275, 1.     ], dtype=float32), 70: ColorArray([0.51373, 0.22745, 0.27451, 1.     ], dtype=float32), 71: ColorArray([0.55686, 0.23137, 0.40784, 1.     ], dtype=float32), 72: ColorArray([0.96863, 0.58824, 0.24706, 1.     ], dtype=float32), 73: ColorArray([0.72941, 0.59216, 0.68627, 1.     ], dtype=float32), 74: ColorArray([0.22353, 0.96863, 0.7451 , 1.     ], dtype=float32), 75: ColorArray([0.02745, 0.01569, 0.92157, 1.     ], dtype=float32), 76: ColorArray([0.35294, 0.56471, 0.10196, 1.     ], dtype=float32), 77: ColorArray([0.65098, 0.16471, 0.39216, 1.     ], dtype=float32), 78: ColorArray([0.59608, 0.89412, 0.73725, 1.     ], dtype=float32), 79: ColorArray([0.4902 , 0.93333, 0.56078, 1.     ], dtype=float32), 80: ColorArray([0.63922, 0.45882, 0.44314, 1.     ], dtype=float32), 81: ColorArray([0.63137, 0.0902 , 0.1098 , 1.     ], dtype=float32), 82: ColorArray([0.61176, 0.37647, 0.18431, 1.     ], dtype=float32), 83: ColorArray([0.9451 , 0.2    , 0.40392, 1.     ], dtype=float32), 84: ColorArray([0.79608, 0.72549, 0.44314, 1.     ], dtype=float32), 85: ColorArray([0.84706, 0.7451 , 0.60392, 1.     ], dtype=float32), 86: ColorArray([0.7098 , 0.2549 , 0.18431, 1.     ], dtype=float32), 87: ColorArray([0.3451 , 0.44706, 0.82353, 1.     ], dtype=float32), 88: ColorArray([0.29412, 0.19608, 0.34902, 1.     ], dtype=float32), 89: ColorArray([0.84706, 0.6902 , 0.24314, 1.     ], dtype=float32), 90: ColorArray([0.75686, 0.8902 , 0.34118, 1.     ], dtype=float32), 91: ColorArray([0.5451 , 0.34118, 0.80784, 1.     ], dtype=float32), 92: ColorArray([0.16078, 0.05098, 0.06275, 1.     ], dtype=float32), 93: ColorArray([0.33725, 0.30196, 0.43529, 1.     ], dtype=float32), 94: ColorArray([0.64314, 0.75294, 0.96078, 1.     ], dtype=float32), 95: ColorArray([0.95294, 0.66667, 0.21961, 1.     ], dtype=float32), 96: ColorArray([0.81569, 0.33725, 0.05882, 1.     ], dtype=float32), 97: ColorArray([0.49412, 0.5451 , 0.4549 , 1.     ], dtype=float32), 98: ColorArray([0.47059, 0.94118, 0.00392, 1.     ], dtype=float32), 99: ColorArray([0.36078, 0.31373, 0.14118, 1.     ], dtype=float32), 100: ColorArray([0.38824, 0.18824, 0.04706, 1.     ], dtype=float32), 101: ColorArray([0.21176, 0.22745, 0.08235, 1.     ], dtype=float32), 102: ColorArray([0.21569, 0.81961, 0.4902 , 1.     ], dtype=float32), 103: ColorArray([0.25882, 0.84706, 0.65098, 1.     ], dtype=float32), 104: ColorArray([0.96078, 0.62353, 0.92941, 1.     ], dtype=float32), 105: ColorArray([0.4549 , 0.29412, 0.12157, 1.     ], dtype=float32), 106: ColorArray([0.99608, 0.96863, 0.1098 , 1.     ], dtype=float32), 107: ColorArray([0.82353, 0.0549 , 0.47451, 1.     ], dtype=float32), 108: ColorArray([0.47059, 0.81569, 0.47059, 1.     ], dtype=float32), 109: ColorArray([0.54902, 0.17647, 0.12157, 1.     ], dtype=float32), 110: ColorArray([0.98431, 0.64314, 0.59216, 1.     ], dtype=float32), 111: ColorArray([0.41176, 0.58431, 0.2902 , 1.     ], dtype=float32), 112: ColorArray([0.80784, 0.54902, 0.51765, 1.     ], dtype=float32), 113: ColorArray([0.73725, 0.60784, 0.35294, 1.     ], dtype=float32), 114: ColorArray([0.62353, 0.30196, 0.2    , 1.     ], dtype=float32), 115: ColorArray([0.03529, 0.48235, 0.54118, 1.     ], dtype=float32), 116: ColorArray([0.31373, 0.33725, 0.72157, 1.     ], dtype=float32), 117: ColorArray([0.11765, 0.2549 , 0.22745, 1.     ], dtype=float32), 118: ColorArray([0.21176, 0.1451 , 0.13725, 1.     ], dtype=float32), 119: ColorArray([0.23529, 0.16078, 0.26275, 1.     ], dtype=float32), 120: ColorArray([0.4902 , 0.21176, 0.7098 , 1.     ], dtype=float32), 121: ColorArray([0.4902 , 0.08235, 0.32157, 1.     ], dtype=float32), 122: ColorArray([0.79216, 0.82353, 0.36078, 1.     ], dtype=float32), 123: ColorArray([0.60784, 0.63529, 0.85882, 1.     ], dtype=float32), 124: ColorArray([0.35686, 0.83529, 0.97255, 1.     ], dtype=float32), 125: ColorArray([0.50588, 0.38431, 0.51373, 1.     ], dtype=float32), 126: ColorArray([0.52549, 0.40392, 0.65882, 1.     ], dtype=float32), 127: ColorArray([0.84314, 0.9451 , 0.4549 , 1.     ], dtype=float32), 128: ColorArray([0.36863, 0.92941, 0.91765, 1.     ], dtype=float32), 129: ColorArray([0.75686, 0.61176, 0.83922, 1.     ], dtype=float32), 130: ColorArray([0.36078, 0.67059, 0.56078, 1.     ], dtype=float32), 131: ColorArray([0.51373, 0.4    , 0.20392, 1.     ], dtype=float32), 132: ColorArray([0.52549, 0.56471, 0.60392, 1.     ], dtype=float32), 133: ColorArray([0.89804, 0.49412, 0.82745, 1.     ], dtype=float32), 134: ColorArray([0.85098, 0.56471, 0.67059, 1.     ], dtype=float32), 135: ColorArray([0.36863, 0.78431, 0.6549 , 1.     ], dtype=float32), 136: ColorArray([0.27843, 0.28235, 0.87451, 1.     ], dtype=float32), 137: ColorArray([0.44314, 0.69804, 0.37647, 1.     ], dtype=float32), 138: ColorArray([0.87059, 0.67059, 0.61176, 1.     ], dtype=float32), 139: ColorArray([0.91373, 0.51765, 0.50196, 1.     ], dtype=float32), 140: ColorArray([0.23529, 0.10588, 0.52941, 1.     ], dtype=float32), 141: ColorArray([0.31373, 0.4    , 0.98039, 1.     ], dtype=float32), 142: ColorArray([0.48235, 0.22353, 0.85882, 1.     ], dtype=float32), 143: ColorArray([0.92549, 0.79216, 0.70588, 1.     ], dtype=float32), 144: ColorArray([0.95686, 0.47059, 0.33333, 1.     ], dtype=float32), 145: ColorArray([0.27843, 0.25882, 0.3451 , 1.     ], dtype=float32), 146: ColorArray([0.10196, 0.16078, 0.15294, 1.     ], dtype=float32), 147: ColorArray([0.18824, 0.9451 , 0.1098 , 1.     ], dtype=float32), 148: ColorArray([0.98039, 0.91765, 0.80392, 1.     ], dtype=float32), 149: ColorArray([0.91373, 0.80784, 0.33725, 1.     ], dtype=float32), 150: ColorArray([0.97255, 0.82745, 0.51373, 1.     ], dtype=float32), 151: ColorArray([0.54118, 0.87843, 0.12157, 1.     ], dtype=float32), 152: ColorArray([0.37255, 0.69412, 0.71373, 1.     ], dtype=float32), 153: ColorArray([0.70588, 0.77255, 0.24314, 1.     ], dtype=float32), 154: ColorArray([0.97255, 0.92941, 0.43137, 1.     ], dtype=float32), 155: ColorArray([0.92549, 0.50588, 0.98431, 1.     ], dtype=float32), 156: ColorArray([0.30196, 0.01569, 0.12941, 1.     ], dtype=float32), 157: ColorArray([0.76863, 0.2    , 0.63137, 1.     ], dtype=float32), 158: ColorArray([0.79608, 0.19608, 0.78039, 1.     ], dtype=float32), 159: ColorArray([0.40784, 0.41569, 0.21961, 1.     ], dtype=float32), 160: ColorArray([0.4549 , 0.43529, 0.36471, 1.     ], dtype=float32), 161: ColorArray([0.50588, 0.30588, 0.26667, 1.     ], dtype=float32), 162: ColorArray([0.56471, 0.77647, 0.63922, 1.     ], dtype=float32), 163: ColorArray([0.78824, 0.43922, 0.57647, 1.     ], dtype=float32), 164: ColorArray([0.4549 , 0.52549, 0.30196, 1.     ], dtype=float32), 165: ColorArray([0.96863, 0.81176, 0.86667, 1.     ], dtype=float32), 166: ColorArray([0.56471, 0.41569, 0.34902, 1.     ], dtype=float32), 167: ColorArray([0.90196, 0.28627, 0.56471, 1.     ], dtype=float32), 168: ColorArray([0.84314, 0.39216, 0.41176, 1.     ], dtype=float32), 169: ColorArray([0.49412, 0.63529, 0.38824, 1.     ], dtype=float32), 170: ColorArray([0.43529, 0.01176, 0.61176, 1.     ], dtype=float32), 171: ColorArray([0.42353, 0.00784, 0.75686, 1.     ], dtype=float32), 172: ColorArray([0.24706, 0.0902 , 0.26275, 1.     ], dtype=float32), 173: ColorArray([0.61176, 0.90196, 0.36471, 1.     ], dtype=float32), 174: ColorArray([0.67059, 0.92549, 0.54118, 1.     ], dtype=float32), 175: ColorArray([0.07451, 0.07059, 0.07843, 1.     ], dtype=float32), 176: ColorArray([0.47451, 0.28627, 0.56078, 1.     ], dtype=float32), 177: ColorArray([0.92941, 0.63137, 0.43529, 1.     ], dtype=float32), 178: ColorArray([0.73725, 0.42353, 0.89804, 1.     ], dtype=float32), 179: ColorArray([0.96863, 0.26667, 0.23137, 1.     ], dtype=float32), 180: ColorArray([0.4    , 0.54118, 0.77255, 1.     ], dtype=float32), 181: ColorArray([0.7098 , 0.4549 , 0.02745, 1.     ], dtype=float32), 182: ColorArray([0.99608, 0.75294, 0.52941, 1.     ], dtype=float32), 183: ColorArray([0.98824, 0.42353, 0.13333, 1.     ], dtype=float32), 184: ColorArray([0.20784, 0.38039, 0.1451 , 1.     ], dtype=float32), 185: ColorArray([0.65882, 0.27843, 0.64706, 1.     ], dtype=float32), 186: ColorArray([0.23529, 0.70588, 0.39608, 1.     ], dtype=float32), 187: ColorArray([0.36078, 0.71765, 0.87059, 1.     ], dtype=float32), 188: ColorArray([0.98431, 0.02353, 0.86667, 1.     ], dtype=float32), 189: ColorArray([0.61961, 0.91765, 0.89804, 1.     ], dtype=float32), 190: ColorArray([0.71765, 0.40784, 0.7451 , 1.     ], dtype=float32), 191: ColorArray([0.67451, 0.30588, 0.34118, 1.     ], dtype=float32), 192: ColorArray([0.72157, 0.31373, 0.48235, 1.     ], dtype=float32), 193: ColorArray([0.97255, 0.43529, 0.65882, 1.     ], dtype=float32), 194: ColorArray([0.76078, 0.88235, 0.71765, 1.     ], dtype=float32), 195: ColorArray([0.47059, 0.1451 , 0.02353, 1.     ], dtype=float32), 196: ColorArray([0.7451 , 0.43137, 0.42745, 1.     ], dtype=float32), 197: ColorArray([0.08235, 0.0902 , 0.19216, 1.     ], dtype=float32), 198: ColorArray([0.2902 , 0.1451 , 0.62353, 1.     ], dtype=float32), 199: ColorArray([0.85098, 0.84314, 0.53333, 1.     ], dtype=float32), 200: ColorArray([0.27843, 0.22745, 0.62353, 1.     ], dtype=float32), 201: ColorArray([0.43137, 0.9098 , 0.38824, 1.     ], dtype=float32), 202: ColorArray([0.57255, 0.78431, 0.27059, 1.     ], dtype=float32), 203: ColorArray([0.33333, 0.26667, 0.72549, 1.     ], dtype=float32), 204: ColorArray([0.4    , 0.15686, 0.33333, 1.     ], dtype=float32), 205: ColorArray([0.42353, 0.16471, 0.47059, 1.     ], dtype=float32), 206: ColorArray([0.73725, 0.70588, 0.26667, 1.     ], dtype=float32), 207: ColorArray([0.78039, 0.57255, 0.14902, 1.     ], dtype=float32), 208: ColorArray([0.84314, 0.58431, 0.33333, 1.     ], dtype=float32), 209: ColorArray([0.37255, 0.42745, 0.67451, 1.     ], dtype=float32), 210: ColorArray([0.40392, 0.32941, 0.28235, 1.     ], dtype=float32), 211: ColorArray([0.57647, 0.99608, 0.24706, 1.     ], dtype=float32), 212: ColorArray([0.90196, 0.27843, 0.02353, 1.     ], dtype=float32), 213: ColorArray([0.88235, 0.5451 , 0.11765, 1.     ], dtype=float32), 214: ColorArray([0.3451 , 0.55686, 0.47059, 1.     ], dtype=float32), 215: ColorArray([0.36078, 0.58039, 0.61961, 1.     ], dtype=float32), 216: ColorArray([0.36471, 0.15294, 0.20784, 1.     ], dtype=float32), 217: ColorArray([0.83529, 0.35686, 0.72941, 1.     ], dtype=float32), 218: ColorArray([0.59216, 0.79608, 0.79608, 1.     ], dtype=float32), 219: ColorArray([0.58039, 0.3451 , 0.35686, 1.     ], dtype=float32), 220: ColorArray([0.23137, 0.15686, 0.77255, 1.     ], dtype=float32), 221: ColorArray([0.27451, 0.72941, 0.55686, 1.     ], dtype=float32), 222: ColorArray([0.78039, 0.71373, 0.78431, 1.     ], dtype=float32), 223: ColorArray([0.71765, 0.76078, 0.61961, 1.     ], dtype=float32), 224: ColorArray([0.72941, 0.20392, 0.48627, 1.     ], dtype=float32), 225: ColorArray([0.38431, 0.67451, 0.2    , 1.     ], dtype=float32), 226: ColorArray([0.6902 , 0.04706, 0.24706, 1.     ], dtype=float32), 227: ColorArray([0.71373, 0.85882, 0.55294, 1.     ], dtype=float32), 228: ColorArray([0.10588, 0.27451, 0.36078, 1.     ], dtype=float32), 229: ColorArray([0.96471, 0.52941, 0.6549 , 1.     ], dtype=float32), 230: ColorArray([0.41176, 0.78824, 0.29412, 1.     ], dtype=float32), 231: ColorArray([0.52941, 0.66667, 0.17255, 1.     ], dtype=float32), 232: ColorArray([0.75686, 0.98039, 0.64706, 1.     ], dtype=float32), 233: ColorArray([0.2549 , 0.24314, 0.21569, 1.     ], dtype=float32), 234: ColorArray([0.9098 , 0.70588, 0.42353, 1.     ], dtype=float32), 235: ColorArray([0.67843, 0.59216, 0.17647, 1.     ], dtype=float32), 236: ColorArray([0.79608, 0.18039, 0.16863, 1.     ], dtype=float32), 237: ColorArray([0.42745, 0.01961, 0.47059, 1.     ], dtype=float32), 238: ColorArray([0.73725, 0.98824, 0.20784, 1.     ], dtype=float32), 239: ColorArray([0.35294, 0.22353, 0.2    , 1.     ], dtype=float32), 240: ColorArray([0.41961, 0.6549 , 0.87451, 1.     ], dtype=float32), 241: ColorArray([0.61961, 0.35686, 0.49804, 1.     ], dtype=float32), 242: ColorArray([0.57255, 0.53725, 0.9098 , 1.     ], dtype=float32), 243: ColorArray([0.44706, 0.09412, 0.19216, 1.     ], dtype=float32), 244: ColorArray([0.80392, 0.73333, 0.9451 , 1.     ], dtype=float32), 245: ColorArray([0.89412, 0.46667, 0.15686, 1.     ], dtype=float32), 246: ColorArray([0.53333, 0.65882, 0.5451 , 1.     ], dtype=float32), 247: ColorArray([0.56078, 0.67843, 0.69804, 1.     ], dtype=float32), 248: ColorArray([0.96078, 0.62353, 0.92941, 1.     ], dtype=float32), 249: ColorArray([0.4549 , 0.29412, 0.12157, 1.     ], dtype=float32), 250: ColorArray([0.99608, 0.96863, 0.1098 , 1.     ], dtype=float32), 251: ColorArray([0.82353, 0.0549 , 0.47451, 1.     ], dtype=float32), 252: ColorArray([0.47059, 0.81569, 0.47059, 1.     ], dtype=float32), 253: ColorArray([0.54902, 0.17647, 0.12157, 1.     ], dtype=float32), 254: ColorArray([0.98431, 0.64314, 0.59216, 1.     ], dtype=float32), 255: ColorArray([0.41176, 0.58431, 0.2902 , 1.     ], dtype=float32), 256: ColorArray([0.80784, 0.54902, 0.51765, 1.     ], dtype=float32)}
    107         lItm.set_color_dictionary(self.color_dict)
    108         self.label_items_array.append(lItm)

File ~\anaconda3\envs\napari-env6\lib\site-packages\napari_annotator\_annotation_entry.py:35, in LabelItem.__init__(self=<napari_annotator._annotation_entry.LabelItem object>, index=1, layer=<Labels layer 'Labels'>, color_dictionary={0: ColorArray([0.48627, 0.4549 , 0.5098 , 1.     ], dtype=float32), 1: ColorArray([0.27843, 0.25882, 0.3451 , 1.     ], dtype=float32), 2: ColorArray([0.10196, 0.16078, 0.15294, 1.     ], dtype=float32), 3: ColorArray([0.18824, 0.9451 , 0.1098 , 1.     ], dtype=float32), 4: ColorArray([0.98039, 0.91765, 0.80392, 1.     ], dtype=float32), 5: ColorArray([0.91373, 0.80784, 0.33725, 1.     ], dtype=float32), 6: ColorArray([0.97255, 0.82745, 0.51373, 1.     ], dtype=float32), 7: ColorArray([0.54118, 0.87843, 0.12157, 1.     ], dtype=float32), 8: ColorArray([0.37255, 0.69412, 0.71373, 1.     ], dtype=float32), 9: ColorArray([0.70588, 0.77255, 0.24314, 1.     ], dtype=float32), ...})
     31 self.qLabel = QPushButton("Label #" + str(self.label))
     32 # set label color as backround
     33 self.qLabel.setStyleSheet(
     34     "background-color: "
---> 35     + QColor(
        self.qLabel = <PyQt5.QtWidgets.QPushButton object at 0x000001F5A4350820>
        self = <napari_annotator._annotation_entry.LabelItem object at 0x000001F5A61D1510>
        QColor = <class 'PyQt5.QtGui.QColor'>
        self.color = ColorArray([0.27843, 0.25882, 0.3451 , 1.     ], dtype=float32)
     36         self.color[0] * 255, self.color[1] * 255, self.color[2] * 255
     37     ).name()
     38 )
     39 self.default_styleSheet = (
     40     self.qLabel.styleSheet()
     41 )  # default font color variable, for resetting purposes
     43 # QWidget shown or not checkbox

TypeError: arguments did not match any overloaded call:
  QColor(color: Qt.GlobalColor): argument 1 has unexpected type 'numpy.float32'
  QColor(rgb: int): argument 1 has unexpected type 'numpy.float32'
  QColor(rgba64: QRgba64): argument 1 has unexpected type 'numpy.float32'
  QColor(variant: Any): too many arguments
  QColor(): too many arguments
  QColor(r: int, g: int, b: int, alpha: int = 255): argument 1 has unexpected type 'numpy.float32'
  QColor(aname: str): argument 1 has unexpected type 'numpy.float32'
  QColor(acolor: Union[QColor, Qt.GlobalColor]): argument 1 has unexpected type 'numpy.float32'

System info: napari: 0.5.4 Platform: Windows-10-10.0.19045-SP0 Python: 3.10.15 | packaged by conda-forge | (main, Oct 16 2024, 01:15:49) [MSC v.1941 64 bit (AMD64)] Qt: 5.15.2 PyQt5: 5.15.11 NumPy: 1.26.4 SciPy: 1.14.1 Dask: 2024.10.0 VisPy: 0.14.3 magicgui: 0.9.1 superqt: 0.6.7 in-n-out: 0.2.1 app-model: 0.3.0 psygnal: 0.11.1 npe2: 0.7.7 pydantic: 2.9.2

OpenGL:

Screens:

Optional:

Settings path:

Steps to reproduce Install the last version of Napari and Napari-annotator Launch Napari, create a Labels layer Launch Napari-annotator

Misc comments When installing napari-annotator through pip install git+https://github.com/loicsauteur/napari-annotator.git, I get ERROR : MainThread : napari.manifest -> 'napari_annotator' could not be imported: The name field in the manifest ('napari-annotator') must match the package name ('napari_annotator')

loicsauteur commented 1 month ago

Hi @TAspert

Thanks for reporting this error. I can reproduce the error. Updates to napari broke the napari-annotator plugin (probably already in napari == 0.4.18).

While I am able to fix this initial problem, the plugin broke also other parts:

These problems may take me longer to fix... Sorry for the inconvenience. I will update you here.