webknossos.skeleton.node
¶
Node
¶
A node in a skeleton tree representing a point in 3D space with additional metadata.
The Node class represents individual points in a skeleton annotation. Each node has a 3D position and can contain additional metadata such as comments, radius, rotation, and viewport information. Nodes are typically created and managed through Tree instances rather than directly.
Attributes:
-
position
(Vec3Int
) –3D coordinates of the node as (x, y, z).
-
comment
(Optional[str]
) –Optional text annotation for the node.
-
radius
(Optional[float]
) –Optional radius value, useful for representing varying thicknesses.
-
rotation
(Optional[Vec3Float]
) –Optional 3D rotation as (x, y, z) in radians.
-
inVp
(Optional[int]
) –Optional viewport number where the node was created.
-
inMag
(Optional[int]
) –Optional magnification level at which the node was created.
-
bitDepth
(Optional[int]
) –Optional bit depth of the data at node creation.
-
interpolation
(Optional[bool]
) –Optional flag indicating if the node was created through interpolation.
-
time
(Optional[int]
) –Optional timestamp for node creation.
-
is_branchpoint
(bool
) –Boolean indicating if this node is a branching point.
-
branchpoint_time
(Optional[int]
) –Optional timestamp when the node was marked as a branchpoint.
Notes
Nodes should typically be created using Tree.add_node()
rather than instantiated directly.
This ensures proper integration with the skeleton structure.
Examples:
# Create a skeleton and tree
skeleton = Skeleton(name="example")
tree = skeleton.add_tree("dendrite")
# Add nodes and connect them
node1 = tree.add_node(position=(0, 0, 0), comment="soma")
node2 = tree.add_node(position=(100, 0, 0), radius=1.5)
tree.add_edge(node1, node2)
# Mark as branchpoint if needed
node1.is_branchpoint = True
- Get Help
- Community Forums
- Email Support