region_grower.modify

Use spatial properties to modify synthesis input.

Functions

input_scaling(params, reference_thickness, ...)

Modifies the input parameters so that grown cells fit into the volume.

output_scaling(root_section, orientation[, ...])

Returns the scaling factor to be applied on Y axis for this neurite.

scale_default_barcode(persistent_homologies, ...)

Modifies the barcode according to the reference and target thicknesses.

scale_target_barcode(persistent_homologies, ...)

Modifies the barcode according to the target thicknesses.

region_grower.modify.input_scaling(params: Dict, reference_thickness: float, target_thickness: float, apical_target_extent: float | None = None, basal_target_extent: float | None = None, debug_info: Dict | None = None)

Modifies the input parameters so that grown cells fit into the volume.

If expected_apical_size is not None, the apical scaling uses a different scaling than the rest of the dendrites.

Parameters:
  • params – the param dictionary that this function will modify.

  • reference_thickness – the expected thickness of input data.

  • target_thickness – the expected thickness that the synthesized cells should live in.

  • apical_target_extent – the expected extent of the apical dendrite.

  • basal_target_extent – the expected extent of the basal dendrite.

  • debug_info – a dictionary in which the debug info will be added.

region_grower.modify.output_scaling(root_section: Section, orientation: List[float], target_min_length: float | None = None, target_max_length: float | None = None) float

Returns the scaling factor to be applied on Y axis for this neurite.

The scaling is chosen such that the neurite is: - upscaled to reach the min target length if it is too short - downscaled to stop at the max target length if it is too long

Parameters:
  • root_section – the neurite for which the scale is computed

  • orientation – 3-array with y direction to project points to get the extend of the cell

  • target_min_length – min length that the neurite must reach

  • target_max_length – max length that the neurite can reach

Returns:

The scale factor to apply.

region_grower.modify.scale_default_barcode(persistent_homologies: List[float], context: Dict, reference_thickness: float, target_thickness: float, with_debug_info: bool = False) List[float]

Modifies the barcode according to the reference and target thicknesses.

Reference thickness defines the property of input data. Target thickness defines the property of space, which should be used by synthesis.

region_grower.modify.scale_target_barcode(persistent_homologies: List[float], context: Dict, target_path_distance: float, with_debug_info: bool = False) List[float]

Modifies the barcode according to the target thicknesses.

Target thickness defines the total extend at which the cell can grow.