napari_track_edit.data_views.views.layers.track_points ====================================================== .. py:module:: napari_track_edit.data_views.views.layers.track_points Classes ------- .. autoapisummary:: napari_track_edit.data_views.views.layers.track_points.TrackPoints Functions --------- .. autoapisummary:: napari_track_edit.data_views.views.layers.track_points.custom_select Module Contents --------------- .. py:function:: custom_select(layer: napari.layers.Points, event: napari.utils.events.Event) Block the current_size signal when selecting points to avoid changing the point size by accident. .. py:class:: TrackPoints(name: str, tracks_viewer: napari_track_edit.data_views.views_coordinator.tracks_viewer.TracksViewer) Bases: :py:obj:`napari_track_edit.data_views.views.layers.out_of_slice_points.ZOnlyPoints` Extended points layer that holds the track information and emits and responds to dynamics visualization signals .. py:attribute:: _drag_modes .. py:attribute:: data_updated .. py:property:: _type_string :type: str .. py:attribute:: tracks_viewer .. py:attribute:: nodes .. py:attribute:: node_index_dict .. py:attribute:: default_size :value: 5 .. py:method:: add(coords: list[float]) Block the current_size event before calling the 'add' function to avoid calling set_point_size (triggered by the current_size event) with a new point size. .. py:property:: selected_data :type: psygnal.containers.Selection[int] Set of currently selected point indices. .. py:method:: process_click(event: napari.utils.events.Event, value: int | None = None, side_button: int | None = None, layer: napari.layers.Points | None = None) Select the clicked point(s) :param event: The mouse event :type event: Event :param value: The index of the clicked point, or None if no point was clicked :type value: int | None :param side_button: the button index (4: back, 5: forward) if a mouse side button was used, or None if no side button was used. :type side_button: int | None :param layer: Optional, unused. The (ortho view) layer on which the click occurred, which is forwarded by default. :type layer: napari.layers.Points | None .. py:method:: set_point_size(size: int) -> None Sets a new default point size. NOTE: This function call is triggered by the current_size event, which is emitted when the user moves the 'point size' slider in the layer controls. However, this event is also emitted in the 'add' and 'select' functions, so we have to block the signals there to avoid increasing the point size by accident, since new or selected points are displayed at a 30% bigger size. .. py:method:: _refresh() Refresh the data in the points layer .. py:method:: _create_node_attrs(new_point: numpy.array) -> tuple[numpy.array, dict] Create attributes for a new node at given time point .. py:method:: _update_data(event: napari.utils.events.Event) Calls the UserActions to update the data in the Tracks object and dispatch the update .. py:method:: _update_selection() Replaces the list of selected_nodes with the selection provided by the user .. py:method:: _map_node_colors(nodes: list[int]) -> numpy.ndarray Look up an (N, 4) array of face colors, one per node. Per node rather than per track id, so the points follow whichever feature the colormap is set to. With no nodes (an empty tracks graph, e.g. when tracking from scratch) a single white color is returned instead of a (0, 4) array: napari's ColorManager treats the color argument as *the* current color when the layer holds no data, and feeding it an empty array raises in `transform_color`. .. py:method:: get_symbols(tracks: funtracks.data_model.Tracks, symbolmap: dict[napari_track_edit.data_views.node_type.NodeType, str]) -> list[str] .. py:method:: update_point_outline(visible_nodes: list[int] | str) -> None Update the outline color of the selected points and visibility according to display mode :param visible_nodes: A list of node ids, or "all" :type visible_nodes: list[int] | str