LayoutConfig#
- class braincell.vis.LayoutConfig(collision_margin_um=2.0, collision_retry_limit=8, stem_collision_window=24, collision_cell_size_um=20.0, default_bend_fraction=0.4, balloon_bend_fraction=0.22, fan_bend_fraction=0.24, radial_bend_fraction=0.25, stem_root_full_span_rad=2.6179938779914944, stem_root_group_span_rad=2.0943951023931953, balloon_root_span_rad=3.141592653589793, balloon_child_span_rad=2.0943951023931953, balloon_type_split_span_rad=1.9198621771937625, fan_root_left_span_rad=1.6580627893946132, fan_root_middle_upper_span_rad=1.2217304763960306, fan_root_middle_lower_span_rad=1.2217304763960306, fan_root_right_span_rad=1.6580627893946132, radial_root_span_rad=6.283185307179586, radial_child_span_rad=2.6179938779914944, legacy_root_child_span_rad=2.0943951023931953, fan_root_left_max_parent_x=0.02, fan_root_middle_min_parent_x=0.35, fan_root_middle_max_parent_x=0.65, stem_collision_weight=100.0, stem_tail_delta_weight=3.0, stem_settle_delta_weight=0.8, stem_overturn_weight=6.0, stem_trunk_tail_delta_weight=0.75, stem_side_opening_weight=2.0)[source]#
Configurable parameters for the 2D layout engine.
- Parameters:
collision_margin_um (
float) – Radius of the “too close” bubble around each placed branch. Any candidate whose closest approach to a previously-placed branch is below this threshold incurs a soft penalty ofmargin - distanceper offending segment pair. Proper intersections incur a flat 1000.0 penalty regardless.collision_retry_limit (
int) – Maximum number of candidate placements the stem-linear solver tries before accepting the best-so-far. Raising this makes dense morphologies cleaner at the cost of linear runtime.stem_collision_window (
int) – How many of the most recently placed branches the stem-tree solver checks for collisions against. With the spatial-hash backend the cost per candidate is roughly linear in the number of segments actually withincollision_cell_size_umof the candidate; a larger window is therefore affordable but still bounded to avoid rescoring the whole tree at deep forks.collision_cell_size_um (
float) – Grid cell size for the 2D spatial-hash collision backend in_collision. Should be a small multiple of the typical branch segment length; too small and the hash wastes memory with sparsely-populated cells, too large and queries degrade toward the O(n²) brute force.default_bend_fraction (
float) – Fraction of a branch’s total length used to bend from the attach tangent to the target angle in the stem-linear and legacy families.balloon_bend_fraction (
float) – Same idea for the balloon family. Smaller values make each branch curve more sharply near its root.fan_bend_fraction (
float) – Same idea for the fan family.radial_bend_fraction (
float) – Same idea for the radial_360 family.fan_root_left_span_rad (
float) – Angular span used for root children attached at the extreme left side of the soma.fan_root_middle_upper_span_rad (
float) – Angular span used for the upper root sector for center-attached children.fan_root_middle_lower_span_rad (
float) – Angular span used for the lower root sector for center-attached children.fan_root_right_span_rad (
float) – Angular span used for root children attached away from the center/right side of the soma.fan_root_left_max_parent_x (
float) – Maximumparent_xclassified into the left sector.fan_root_middle_min_parent_x (
float) – Inclusive lower bound of the center band.fan_root_middle_max_parent_x (
float) – Inclusive upper bound of the center band.stem_root_full_span_rad (
float) – Full angular span used for root children whenroot_layoutis not'type_split'(all children packed into one arc).stem_root_group_span_rad (
float) – Angular span allocated per group (axon group or dendrite group) whenroot_layout='type_split'. The two groups sit on opposite half-planes centered on±π/2.balloon_root_span_rad (
float) – Angular span used by the balloon family for the root fork when not splitting by type.balloon_child_span_rad (
float) – Angular span used by the balloon family for each non-root fork, centered on the parent’s tangent.balloon_type_split_span_rad (
float) – Per-group span for the balloon family whenroot_layout='type_split'.radial_root_span_rad (
float) – Angular span used by the radial_360 family for the root fork (defaults to a full 2π).radial_child_span_rad (
float) – Angular span used by the radial_360 family for each non-root fork.legacy_root_child_span_rad (
float) – Angular span for root children in the legacy layout.stem_collision_weight (
float) – Weight applied to the raw collision score when computing the total stem-tree score. Withcollision_weight=100a single intersection (score1000.0) contributes100 000to the total, which dominates every other term — intentional, since intersections are always worse than a bad angle.stem_tail_delta_weight (
float) – Weight on the tail-angle deviation from the desired target. Increase to make the engine more faithful to the target angle at the cost of possible overlap.stem_settle_delta_weight (
float) – Weight on the “settle” angle deviation from the tail. Keeps the mid-branch from over-rotating between launch and tail.stem_overturn_weight (
float) – Weight on turns wider than π/2 between launch and tail. Discourages hairpin turns.stem_trunk_tail_delta_weight (
float) – Extra per-trunk penalty on tail deviation from the attach tangent. Keeps trunks visually continuous across a fork.stem_side_opening_weight (
float) – Extra per-side penalty that rewards launches “opening away” from the desired tail by at leastmax(|desired|, 55°).