aics-int / napari-allencell-annotator

Other
0 stars 1 forks source link

82 point pre annotating #92

Closed memeramita closed 3 months ago

memeramita commented 3 months ago

Context

82 We want to add point annotation as an option when the user creates an annotation template. By doing so, the default field is hidden. After the template is created, the 'Select' button is disabled before the annotation starts. This PR also makes sure that the user can save and load a template containing point annotations in the json format.

Changes

  1. annotation_item.py

__init__():

fill_vals_point(): for existing point annotations, set the option to "point" and fill in the annotation name

type_changed():

get_data(): Added an if statement to set type and default for point annotation.

  1. annotation_widget.py

add_existing_item(): Added an if statement to fill in values for existing point annotations.

  1. template_item.py

ItemType: Added "point" as POINT.

__init__(): If it's a point annotation item, center and disable the button. Otherwise, add the name and the widget to the layout as usual and enable the widget.

  1. template_item.py

add_item(): added an if statement for point annotation which sets annot_type and creates a QPushButton widget.

  1. Write tests for new and modified functions in annotation_item_test.py, annotation_widget_test.py, template_list_test.py