Skip to content

webknossos.skeleton.group

Classes:

Group

Methods:

  • add_graph

    Deprecated, please use add_tree.

  • add_group

    Adds a (sub) group to the current group with the provided name.

  • add_tree

    Adds a tree to the current group. If the first parameter is a string,

  • as_nml_group

    Returns a named tuple representation of this group.

  • flattened_graphs

    Deprecated, please use flattened_trees.

  • flattened_groups

    Returns an iterator of all groups within this group (and its subgroups).

  • flattened_trees

    Returns an iterator of all trees within this group (and its subgroups).

  • get_graph_by_id

    Deprecated, please use get_tree_by_id.

  • get_group_by_id

    Returns the group which has the specified group id.

  • get_max_graph_id

    Deprecated, please use get_max_tree_id.

  • get_max_node_id

    Returns the highest node id of all nodes of all trees within this group (and its subgroups).

  • get_max_tree_id

    Returns the highest tree id of all trees within this group (and its subgroups).

  • get_node_by_id

    Returns the node which has the specified node id.

  • get_total_node_count

    Returns the total number of nodes of all trees within this group (and its subgroups).

  • get_tree_by_id

    Returns the tree which has the specified tree id.

  • has_tree_id

    Returns true if this group (or a subgroup) contains a tree with the given id.

  • remove_tree_by_id

Attributes:

  • children (Iterator[GroupOrTree]) –

    Returns all (immediate) children (groups and trees) as an iterator.

  • graphs (Iterator[Tree]) –

    Deprecated, please use trees.

  • groups (Iterator[Group]) –

    Returns all (immediate) group children as an iterator.

  • id (int) –

    Read-only property.

  • name (str) –
  • trees (Iterator[Tree]) –

    Returns all (immediate) tree children as an iterator.

children property

children: Iterator[GroupOrTree]

Returns all (immediate) children (groups and trees) as an iterator.

graphs property

graphs: Iterator[Tree]

Deprecated, please use trees.

groups property

groups: Iterator[Group]

Returns all (immediate) group children as an iterator. Use flattened_groups if you need also need groups within subgroups.

id property

id: int

Read-only property.

name instance-attribute

name: str

trees property

trees: Iterator[Tree]

Returns all (immediate) tree children as an iterator. Use flattened_trees if you need also need trees within subgroups.

add_graph

add_graph(name: str, color: Optional[Union[Vector4, Vector3]] = None, _enforced_id: Optional[int] = None) -> Tree

Deprecated, please use add_tree.

add_group

add_group(name: str, _enforced_id: Optional[int] = None) -> Group

Adds a (sub) group to the current group with the provided name.

add_tree

add_tree(name_or_tree: Union[str, Tree], color: Optional[Union[Vector4, Vector3]] = None, _enforced_id: Optional[int] = None) -> Tree

Adds a tree to the current group. If the first parameter is a string, a new tree will be added with the provided name and color if specified. Otherwise, the first parameter is assumed to be a tree object (e.g., from another skeleton). A copy of that tree will then be added. If the id of the tree already exists, a new id will be generated.

as_nml_group

as_nml_group() -> Group

Returns a named tuple representation of this group.

flattened_graphs

flattened_graphs() -> Iterator[Tree]

Deprecated, please use flattened_trees.

flattened_groups

flattened_groups() -> Iterator[Group]

Returns an iterator of all groups within this group (and its subgroups).

flattened_trees

flattened_trees() -> Iterator[Tree]

Returns an iterator of all trees within this group (and its subgroups).

get_graph_by_id

get_graph_by_id(graph_id: int) -> Tree

Deprecated, please use get_tree_by_id.

get_group_by_id

get_group_by_id(group_id: int) -> Group

Returns the group which has the specified group id.

get_max_graph_id

get_max_graph_id() -> int

Deprecated, please use get_max_tree_id.

get_max_node_id

get_max_node_id() -> int

Returns the highest node id of all nodes of all trees within this group (and its subgroups).

get_max_tree_id

get_max_tree_id() -> int

Returns the highest tree id of all trees within this group (and its subgroups).

get_node_by_id

get_node_by_id(node_id: int) -> Node

Returns the node which has the specified node id.

get_total_node_count

get_total_node_count() -> int

Returns the total number of nodes of all trees within this group (and its subgroups).

get_tree_by_id

get_tree_by_id(tree_id: int) -> Tree

Returns the tree which has the specified tree id.

has_tree_id

has_tree_id(tree_id: int) -> bool

Returns true if this group (or a subgroup) contains a tree with the given id.

remove_tree_by_id

remove_tree_by_id(tree_id: int) -> None