84 Create functions create_points_layer and get_selected_points in viewer.py for adding point layers and getting selected points from point layers to support point annotation.
Changes
viewer.py
create_points_layer(): Create a new Points layer and set it to ADD mode to allow users to add points to the layer.
get_selected_points(): Get selected points in a point layer as a list of point tuples.
I implemented the following class and functions to support create_points_layer and get_selected_points
PointsLayerMode: This Enum class is added to store Points layer modes.
get_all_points_layers(): A helper function to get all Points layers in the viewer.
order_point(): Rearrange each point's dimension to the same order as the image.
set_points_layer_mode(): Called to set the mode of a Points layer.
i_viewer.py
I added get_all_points_layers, create_points_layer, and get_selected_points to reflect the changes in viewer.py
fake_viewer.py
I created self._points_layers to keep track of fake Points layers and implemented fake methods get_all_points_layers, create_points_layer, and get_selected_points.
Context
84 Create functions
create_points_layer
andget_selected_points
in viewer.py for adding point layers and getting selected points from point layers to support point annotation.Changes
viewer.py
create_points_layer()
: Create a new Points layer and set it to ADD mode to allow users to add points to the layer.get_selected_points()
: Get selected points in a point layer as a list of point tuples.I implemented the following class and functions to support
create_points_layer
andget_selected_points
PointsLayerMode
: This Enum class is added to store Points layer modes.get_all_points_layers()
: A helper function to get all Points layers in the viewer.order_point()
: Rearrange each point's dimension to the same order as the image.set_points_layer_mode()
: Called to set the mode of a Points layer.i_viewer.py
get_all_points_layers
,create_points_layer
, andget_selected_points
to reflect the changes inviewer.py
fake_viewer.py
self._points_layers
to keep track of fake Points layers and implemented fake methodsget_all_points_layers
,create_points_layer
, andget_selected_points
.