napari_track_edit.data_views.views.tree_view.navigation_widget

Classes

NavigationWidget

Module Contents

class napari_track_edit.data_views.views.tree_view.navigation_widget.NavigationWidget(track_df: pandas.DataFrame, lineage_df: pandas.DataFrame, view_direction: str, selected_nodes: napari_track_edit.data_views.NodeSelectionHistory, plot_type: str)

Bases: qtpy.QtWidgets.QWidget

track_df
lineage_df
view_direction
selected_nodes
plot_type
feature = None
move(direction: str) → None

Move in the given direction on the tree view. Will select the next node in that direction, based on the orientation of the widget.

Parameters:

direction (str) – The direction to move. Options: “up”, “down”, “left”, “right”

get_next_track_node(df: pandas.DataFrame, node_id: str, forward=True) → str | None

Get the node at the same time point in an adjacent track.

Parameters:
  • df (pd.DataFrame) – The dataframe to be used (full track_df or subset lineage_df).

  • node_id (str) – The current node ID to get the next from.

  • forward (bool, optional) – If true, pick the next track (right/down). Otherwise, pick the previous track (left/up). Defaults to True.

get_predecessor(node_id: str) → str | None

Get the predecessor node of the given node_id

Parameters:

node_id (str) – the node id to get the predecessor of

Returns:

THe node id of the predecessor, or none if no predecessor is found

Return type:

str | None

get_successor(node_id: str) → str | None

Get the successor node of the given node_id. If there are two children, picks one arbitrarily.

Parameters:

node_id (str) – the node id to get the successor of

Returns:

THe node id of the successor, or none if no successor is found

Return type:

str | None