BranchData#
- class braintools.visualize.morphology.BranchData(index, name, type, parent_index, parent_x, child_x, lengths, radii_proximal, radii_distal, points_proximal=None, points_distal=None)[source]#
Geometry and attachment of one unbranched section of a morphology.
A branch is a chain of
n_segfrusta (segments). Segmentkruns from radiusradii_proximal[k]toradii_distal[k]overlengths[k].- Parameters:
index (
int) – Position of this branch inMorphologyData.branches.name (
str) – Branch name, unique within the morphology. Unlikeindex, it is the identifier that survives edits of the source morphology.type (
str) – Branch type, such as"soma","axon","basal_dendrite","apical_dendrite". Selects the colour of the branch.parent_index (
int|None) – Index of the parent branch,Nonefor the root.parent_x (
float|None) – Normalised position[0, 1]on the parent where this branch is attached;Nonefor the root.child_x (
float|None) – Normalised position[0, 1]on this branch that touches the parent;Nonefor the root.lengths (
Quantity) – Segment lengths, shape(n_seg,), a length unit.radii_proximal (
Quantity) – Segment end radii, shape(n_seg,), a length unit.radii_distal (
Quantity) – Segment end radii, shape(n_seg,), a length unit.points_proximal (
Quantity|None) – Segment end points, shape(n_seg, 3), a length unit. Both or neither must be given; without them only the automatic 2-D layouts are available.points_distal (
Quantity|None) – Segment end points, shape(n_seg, 3), a length unit. Both or neither must be given; without them only the automatic 2-D layouts are available.
- Raises:
TypeError – If a geometry field is not a Quantity with a length unit.
ValueError – If the geometry arrays disagree in shape or are empty.
Examples
>>> import brainunit as u >>> from braintools.visualize.morphology import BranchData >>> soma = BranchData( ... index=0, name="soma", type="soma", parent_index=None, ... parent_x=None, child_x=None, lengths=[10.0] * u.um, ... radii_proximal=[5.0] * u.um, radii_distal=[5.0] * u.um, ... ) >>> soma.n_segments 1 >>> soma.length Quantity(10., "um")
- property length: Quantity#
Total path length of the branch.