RodTracker.ui.rod_tree

TBD

class RodTree(*args, **kwargs)[source]

Bases: QTreeWidget

A custom QTreeWidget to display all loaded rods as a tree.

Parameters
  • *args (iterable) – Positional arguments for the QTreeWidget superclass.

  • **kwargs (dict) – Keyword arguments for the QTreeWidget superclass.

rod_info

Holds the loaded information of the rod dataset about a rod being 'seen' or 'unseen'.

Dimensions: (frame, color, particle, camera)

Type

None | Dict[Dict[Dict[list]]]

batch_update_tree(new_data: dict, cam_ids: list)[source]

Updates the displayed tree with multiple changed or new particles.

Unlike update_tree() this method is capable of updating multiple particles in a previously setup tree, this includes previously not existing particles.

Parameters
  • new_data (Dict[int, Dict[str, Dict[int, list]]]) –

    Information of the rod dataset about a rod being 'seen' or 'unseen'.

    Dimensions: (frame, color, particle, camera)

  • cam_ids (list) – List of camera IDs on which a rod can be 'seen'/'unseen'.

generate_tree()[source]

(Re)generates the tree for display of loaded rod data.

new_rod(frame: int, color: str, rod_number: int)[source]

Insert a new rod into the loaded dataset.

Parameters
  • frame (int) –

  • color (str) –

  • rod_number (int) –

setup_tree(rod_info: dict, columns: list)[source]

Handles the setup of the treeview from extracted rod data.

Accepts a new rod_info dataset and (re-)sets the tree display of it.

Parameters
  • rod_info (Dict[Dict[Dict[list]]]) –

    Information of the rod dataset about a rod being 'seen' or 'unseen'.

    Dimensions: (frame, color, particle, camera)

  • columns (list) – List of camera IDs on which a rod can be 'seen'/'unseen'.

update_tree(new_data: dict)[source]

Update the seen status in the rod data tree.

Parameters

new_data (dict) –

Information about the rod, whos seen status has changed. Mandatory keys:

"frame", "cam_id", "color", "seen", "rod_id"

update_tree_folding(frame: int, color: str)[source]

Updates the folding of the tree view.

The tree view is updated in synchrony with the UI switching frames and colors. The corresponding portion of the tree is expanded and moved into view.

Parameters
  • frame (int) –

  • color (str) –