neuron_morphology.features.size
¶
Module Contents¶
Functions¶
total_length (data: MorphologyLike, node_types: Optional[List[int]] = None) → float 
Calculate the total length across all compartments in a reconstruction 
total_surface_area (data: MorphologyLike, node_types: Optional[List[int]] = None) → float 
Calculates the sum of lateral surface areas across all comparments 
total_volume (data: MorphologyLike, node_types: Optional[List[int]] = None) → float 
Calculates the sum of volumes across all comparments (linked pairs of 
mean_diameter (data: MorphologyLike, node_types: Optional[List[int]] = None) → float 
Calculates the mean diameter of all nodes 
parent_daughter_ratio_visitor (node: Dict[str, Any], morphology: Morphology, counters: Dict[str, Union[int, float]], node_types: Optional[List[int]] = None) 
Calculates for a single node the ratio of the node’s parent’s radius to 
mean_parent_daughter_ratio (data: MorphologyLike, node_types: Optional[List[int]] = None) → float 
Calculate the average ratio of parent radii to child radii across a 
max_euclidean_distance (data: MorphologyLike, node_types: Optional[List[int]] = None) → float 
Calculate the furthest distance, in 3space, of a compartment’s end from 

neuron_morphology.features.size.
total_length
(data: MorphologyLike, node_types: Optional[List[int]] = None) → float¶ Calculate the total length across all compartments in a reconstruction
Parameters:  data : the input reconstruction
 node_types : if provided, restrict the calculation to compartments
involving these types
Returns:  The sum of segment lengths across all segments in the reconstruction
Notes
 Excludes compartments where the parent is:
 the soma
 a root of the reconstruction
The logic here is that the soma root is likely to substantially overlap any of its compartments, while nonroot soma nodes will be closer to the soma surface.

neuron_morphology.features.size.
total_surface_area
(data: MorphologyLike, node_types: Optional[List[int]] = None) → float¶ Calculates the sum of lateral surface areas across all comparments (linked pairs of nodes) in a reconstruction. This approximates the total surface area of the reconstruction. See Morphology.get_compartment_surface_area for details.
Parameters:  data : The reconstruction whose surface area will be computed
 node_types : restrict the calculation to compartments involving these node
types
Returns:  The sum of compartment lateral surface areas across this reconstruction

neuron_morphology.features.size.
total_volume
(data: MorphologyLike, node_types: Optional[List[int]] = None) → float¶ Calculates the sum of volumes across all comparments (linked pairs of nodes) in a reconstruction. This approximates the total volume of the reconstruction. See Morphology.get_compartment_volume for details.
Parameters:  data : The reconstruction whose volume will be computed
 node_types : restrict the calculation to compartments involving these node
types
Returns:  The sum of compartment volumes across this reconstruction

neuron_morphology.features.size.
mean_diameter
(data: MorphologyLike, node_types: Optional[List[int]] = None) → float¶ Calculates the mean diameter of all nodes
Parameters:  morphology : The reconstruction whose mean diameter
 node_types : restrict the calculation to compartments involving these node
types
Returns:  The average diameter across selected nodes

neuron_morphology.features.size.
parent_daughter_ratio_visitor
(node: Dict[str, Any], morphology: Morphology, counters: Dict[str, Union[int, float]], node_types: Optional[List[int]] = None)¶ Calculates for a single node the ratio of the node’s parent’s radius to the node’s radius. Stores these values in a provided dictionary.
Parameters:  node : The node under consideration
 morphology : The reconstruction to which this node belongs
 counters : a dictionary used for storing running ratio totals and counts.
 node_types : skip nodes not of one of these types
Notes
see mean_parent_daughter_ratio for usage

neuron_morphology.features.size.
mean_parent_daughter_ratio
(data: MorphologyLike, node_types: Optional[List[int]] = None) → float¶ Calculate the average ratio of parent radii to child radii across a reconstruction.
Parameters:  data : The reconstruction whose mean parent daugther ratio will be computed
 node_types : restrict the calculation to compartments involving these node
types
Notes
Note that this function differs from the Lmeasure parent daughter ratio, which calculates the ratio of the child node size to the parent. Note also that both the parent and child must be in node_types in order for a compartment to be included in the calculation

neuron_morphology.features.size.
max_euclidean_distance
(data: MorphologyLike, node_types: Optional[List[int]] = None) → float¶ Calculate the furthest distance, in 3space, of a compartment’s end from the soma. This is equivalent to the distance to the furthest SWC node.
Parameters:  data: The reconstruction whose max euclidean distance will be
calculated
 node_types: restrict consideration to these types
Returns:  The distance between the soma and the farthestfromsoma node in this
 morphology.