motile_plugin.data_views.views.layers.track_labels

Classes

TrackLabels

Extended labels layer that holds the track information and emits

Module Contents

class motile_plugin.data_views.views.layers.track_labels.TrackLabels(viewer: napari.Viewer, data: numpy.array, name: str, opacity: float, scale: tuple, tracks_viewer: motile_plugin.data_views.views_coordinator.tracks_viewer.TracksViewer)

Bases: napari.layers.Labels

Extended labels layer that holds the track information and emits and responds to dynamics visualization signals

property _type_string: str
tracks_viewer
node_properties
viewer
_get_node_properties()
redo()

Overwrite the redo functionality of the labels layer and invoke redo action on the tracks_viewer.tracks_controller first

undo()

Overwrite undo function and invoke undo action on the tracks_viewer.tracks_controller

_parse_paint_event(event_val)

_summary_

Args:
event_val (list[tuple]): A list of paint “atoms” generated by the labels layer.

Each atom is a 3-tuple of arrays containing: - a numpy multi-index, pointing to the array elements that were changed (a tuple with len ndims) - the values corresponding to those elements before the change - the value after the change

Returns:
tuple(int, list[tuple]): The new value, and a list of node update actions

defined by the time point and node update item Each “action” is a 2-tuple containing: - a numpy multi-index, pointing to the array elements that were changed (a tuple with len ndims) - the value before the change

_on_paint(event)

Listen to the paint event and check which track_ids have changed

_refresh()

Refresh the data in the labels layer

update_label_colormap(visible: list[int] | str) None

Updates the opacity of the label colormap to highlight the selected label and optionally hide cells not belonging to the current lineage

new_colormap()

Extended version of existing function, to emit refresh signal to also update colors in other layers/widgets

_check_selected_label()

Check whether the selected label is larger than the current max_track_id and if so add it to the colormap (otherwise it draws in transparent color until the refresh event)