aics-int / napari-allencell-annotator

Other
0 stars 1 forks source link

maintain points layer colors #101

Open memeramita opened 3 months ago

memeramita commented 3 months ago

Issue

Point annotation colors are determined based on the order that points layers are created. Therefore, the colors can be different when I revisit an image I have already annotated. This happens when I do not annotate point annotations in the same order as how the annotations are stored in the dictionary. For example, if I have point annotations named a, b, c (stored in the dictionary in this order) and I annotate c, then b, and then a, the colors will be c-green, b-fuchsia, a-red. If I go to another image and back to this image again, since the plugin reads from the dictionary, the colors will be a-green, b-fuchsia, and c-red instead.

Steps to reproduce

  1. Create multiple point annotations in the template.
  2. Annotate point annotations in a different order than what is showing in the UI.
  3. Go to another image and back to this image.
  4. The color associated with each point annotation will be different.

Note

The colors are determined from a list of colors self.colors in viewer.py. A color is selected by indexing this list with the number of existing points layers in create_points_layer(). I think this need to be modified.