webknossos.skeleton.skeleton
Representation of the skeleton of an Annotation
.
It contains metadata to identify the related dataset and is the root-group of sub-groups and trees.
See the parent class Group
for methods about group and tree handling.
To upload a skeleton to webknossos, please create an Annotation()
with it.
A small usage example:
annotation = Annotation(
name="my_annotation", dataset_name="my_dataset", voxel_size=(11, 11, 24)
)
group = annotation.skeleton.add_group("a group")
tree = group.add_tree("a tree")
node_1 = tree.add_node(position=(0, 0, 0), comment="node 1")
node_2 = tree.add_node(position=(100, 100, 100), comment="node 2")
tree.add_edge(node_1, node_2)
Also see this example for a more complex interaction.
To initialize a skeleton, setting the following parameters is required (or recommended):
- voxel_size
- dataset_name
- organization_id
- description
Should not be used with Skeleton
, this attribute is only useful for sub-groups. Set to Root
.
Deprecated, please use voxel_size
.
Loads a .nml
file or a .zip
file containing an NML (and possibly also volume
layers). Returns the Skeleton
object. Also see Annotation.load
if you want to
have the annotation which wraps the skeleton.
Stores the skeleton as a zip or nml at the given path.
Deprecated. Use Skeleton.load instead.
Deprecated. Use Skeleton.save instead.