motile_plugin.data_views.views_coordinator.tracks_viewer

Classes

TracksViewer

Purposes of the TracksViewer:

Module Contents

class motile_plugin.data_views.views_coordinator.tracks_viewer.TracksViewer(viewer: napari.viewer)

Purposes of the TracksViewer: - Emit signals that all widgets should use to update selection or update

the currently displayed Tracks object

  • Storing the currently displayed tracks

  • Store shared rendering information like colormaps (or symbol maps)

tracks_updated
classmethod get_instance(viewer=None)
viewer
colormap
symbolmap: dict[motile_plugin.data_model.NodeType, str]
mode = 'all'
tracks = None
visible = None
tracking_layers
selected_nodes
tracks_list
set_keybinds()
_refresh(node: str | None = None, refresh_view: bool = False) None

Call refresh function on napari layers and the submit signal that tracks are updated Restore the selected_nodes, if possible

update_tracks(tracks: motile_plugin.data_model.Tracks, name: str) None

Stop viewing a previous set of tracks and replace it with a new one. Will create new segmentation and tracks layers and add them to the viewer.

Args:

tracks (motile_plugin.core.Tracks): The tracks to visualize in napari. name (str): The name of the tracks to display in the layer names

toggle_display_mode(event=None) None

Toggle the display mode between available options

set_display_mode(mode: str) None

Update the display mode and call to update colormaps for points, labels, and tracks

filter_visible_nodes() list[int]

Construct a list of track_ids that should be displayed

update_highlights() None

If the time dimension is changed, update the highlighting in the seg layer

update_selection() None

Sets the view and triggers visualization updates in other components

view_external_tracks(tracks: motile_plugin.data_model.SolutionTracks, name: str) None

View tracks created externally. Assigns tracklet ids, adds a hypothesis dimension to the segmentation, and relabels the segmentation based on the assigned track ids. Then calls update_tracks.

Args:

tracks (Tracks): A tracks object to view, created externally from the plugin name (str): The name to display in napari layers

set_napari_view() None

Adjust the current_step of the viewer to jump to the last item of the selected_nodes list

delete_node(event=None)

Calls the tracks controller to delete currently selected nodes

set_split_node(event=None)
set_endpoint_node(event=None)
set_linear_node(event=None)
delete_edge(event=None)

Calls the tracks controller to delete an edge between the two currently selected nodes

create_edge(event=None)

Calls the tracks controller to add an edge between the two currently selected nodes

undo(event=None)
redo(event=None)