SWC#
- class swick.SWC(nodes: dict[int, swick.node.Node])#
Bases:
object
A representation of the
.swc
file, which contains a mapping from node IDs toNode
objects.- Parameters:
nodes – a
dict
mapping IDs to theNode
s belonging to thisSWC
- condense_node_ids()#
Modifies the IDs of the
Node
s contained by thisSWC
such that they form a contiguous series of natural numbers beginning at 1. The order of node IDs will not change, i.e. a node ID that is greater than another given node ID before this operation will still be greater afterwards.
- total_length()#
Calculates and returns the sum of the Euclidean distances between each pair of connected nodes in this
SWC
.- Returns:
the sum of the distances between each pair of connected nodes in this
SWC