motile_plugin.widgets.tracks_view.tracks_viewer

Classes

TracksLayerGroup

TracksViewer

Purposes of the TracksViewer:

Module Contents

class motile_plugin.widgets.tracks_view.tracks_viewer.TracksLayerGroup
tracks_layer: motile_plugin.layers.track_graph.TrackGraph | None = None
seg_layer: motile_plugin.layers.track_labels.TrackLabels | None = None
points_layer: motile_plugin.layers.track_points.TrackPoints | None = None
class motile_plugin.widgets.tracks_view.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)

  • Interacting with the napari.Viewer by adding and removing layers

tracks_updated
classmethod get_instance(viewer=None)
viewer
selected_nodes
tracking_layers
tracks = None
colormap
symbolmap: dict[motile_plugin.core.NodeType, str]
mode = 'all'
remove_napari_layer(layer: napari.layers.Layer | None) None

Remove a layer from the napari viewer, if present

remove_napari_layers() None

Remove all tracking layers from the viewer

add_napari_layers() None

Add new tracking layers to the viewer

view_external_tracks(tracks: motile_plugin.core.Tracks, 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

update_tracks(tracks: motile_plugin.core.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

Args:

mode (str): “all” or “lineage”

filter_visible_nodes() list[int]

Construct a list of track_ids that should be displayed

update_selection() None

Sets the view and triggers visualization updates in other components

set_napari_view() None

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