CVContext#

class braincell.mech.CVContext(cv_id, branch_id, branch_name, branch_type, prox, dist, midpoint, length, area, radius_mid, diam_arc_mean, path_distance_to_root, path_distance_from_soma, _local_position=None)[source]#

Read-only geometry context for one control volume.

Callable cable and density parameters receive one context per control volume. All physical fields carry brainunit units, while prox, dist, and midpoint are normalized branch coordinates in [0, 1].

Parameters:
  • cv_id (int) – Stable control-volume index.

  • branch_id (int) – Owning morphology branch index.

  • branch_name (str) – Owning morphology branch name.

  • branch_type (str) – Owning morphology branch type.

  • prox (float) – Normalized control-volume bounds and midpoint.

  • dist (float) – Normalized control-volume bounds and midpoint.

  • midpoint (float) – Normalized control-volume bounds and midpoint.

  • length (Quantity) – Control-volume cable length.

  • area (Quantity) – Control-volume lateral membrane area.

  • radius_mid (Quantity) – Radius at the control-volume midpoint.

  • diam_arc_mean (Quantity) – Arc-length-weighted mean diameter over the control volume.

  • path_distance_to_root (Quantity) – Tree path distance from root-branch coordinate x=0 to the control-volume midpoint.

  • path_distance_from_soma (Quantity) – Shortest tree path distance from the union of all soma branches. If there is no soma branch, the whole root branch is the reference.

  • local_position (Quantity) – Morphology-local 3-D midpoint position. Access raises ValueError when full point geometry is unavailable.

  • position (Quantity) – Morphology-local 3-D midpoint position. Access raises ValueError when full point geometry is unavailable.

property diam_mid: Quantity#

Diameter at the control-volume midpoint, i.e. 2 * radius_mid.

property local_position: Quantity#

Morphology-local 3-D control-volume midpoint position.

property position: Quantity#

World position, equal to local_position until transforms land.