Skip to content

Commit

Permalink
Add empty features to avoid error when passing feature_defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
constantinpape committed May 1, 2023
1 parent 813ea1f commit 9212326
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/tutorials/annotation/annotate_points.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def point_annotator(

viewer = napari.view_image(stack)
points_layer = viewer.add_points(
feature_defaults={'label': labels},
features={"label": np.array([], dtype=str)}, # we need to set empty features to set defaults
feature_defaults={'label': labels[:1]}, # set the first label as default feature
edge_color='label',
edge_color_cycle=COLOR_CYCLE,
symbol='o',
Expand Down

0 comments on commit 9212326

Please sign in to comment.