I am trying to use the interactive mode to annotate cell
viewer = img.interactive(adata)
shapes_layer = viewer.add_shapes(polygons, shape_type='polygon', edge_width=5,
edge_color='coral', face_color='royalblue')
however I encountered
Traceback (most recent call last):
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/squidpy/pl/_interactive/_widgets.py", line 41, in <lambda>
self.itemDoubleClicked.connect(lambda item: self._onAction((item.text(),)))
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/squidpy/pl/_interactive/_widgets.py", line 146, in _onAction
self._controller.add_points(vec, key=item, layer_name=name)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/squidpy/pl/_interactive/_controller.py", line 175, in add_points
layer: Points = self.view.viewer.add_points(
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/components/viewer_model.py", line 5, in add_points
import os
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/_collections_abc.py", line 1073, in append
self.insert(len(self), value)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/components/layerlist.py", line 135, in insert
super().insert(index, new_layer)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/utils/events/containers/_selectable_list.py", line 65, in insert
super().insert(index, value)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/utils/events/containers/_evented_list.py", line 183, in insert
self.events.inserted(index=index, value=value)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/utils/events/event.py", line 715, in __call__
self._invoke_callback(cb, event if pass_event else None)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/utils/events/event.py", line 752, in _invoke_callback
_handle_exception(
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/utils/events/event.py", line 739, in _invoke_callback
cb(event)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/_qt/qt_viewer.py", line 488, in _on_add_layer_change
self._add_layer(layer)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/_qt/qt_viewer.py", line 498, in _add_layer
vispy_layer = create_vispy_visual(layer)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/_vispy/utils/visual.py", line 63, in create_vispy_visual
return visual_class(layer)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/_vispy/layers/points.py", line 39, in __init__
self._on_data_change()
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/_vispy/layers/points.py", line 82, in _on_data_change
self.reset()
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/_vispy/layers/points.py", line 181, in reset
self._on_symbol_change()
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/_vispy/layers/points.py", line 85, in _on_symbol_change
self.node.symbol = self.layer.symbol
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/vispy/util/frozen.py", line 17, in __setattr__
object.__setattr__(self, key, value)
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/napari/_vispy/visuals/points.py", line 32, in symbol
marker.symbol = value
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/vispy/util/frozen.py", line 13, in __setattr__
if self.__isfrozen and not hasattr(self, key):
File "/Users/xiangwang/opt/anaconda3/lib/python3.9/site-packages/vispy/visuals/markers.py", line 650, in symbol
return np.vectorize(value_to_symbol.get)(self._data['a_symbol'])
TypeError: 'NoneType' object is not subscriptable
With the plot not showing what layer I am trying to see and add shape to it