axon_synthesis.synthesis.main_trunk.create_graph¶
Create the edges between the terminals and the obstacles (if any).
This is needed to easily compute a Steiner Tree (Euclidean Steiner Tree is complicated).
Functions
|
Create the nodes and edges for one axon based on the target points and the atlas. |
Classes
|
Class to store the parameters needed for graph creation. |
- class axon_synthesis.synthesis.main_trunk.create_graph.CreateGraphConfig(intermediate_number: int = 5, min_intermediate_distance: float = 1000, min_random_point_distance: float | None = None, random_max_tries: int = 10, random_point_bbox_buffer: float = 0, voronoi_steps: int = 1, duplicate_precision: float = 0.001, use_orientation_penalty: bool = True, orientation_penalty_exponent: float = 0.1, orientation_penalty_amplitude: float = 1, use_depth_penalty: bool = True, depth_penalty_sigma: float = 0.25, depth_penalty_amplitude: float = 10, preferred_regions: int | str | list[int | str] | None = None, preferred_region_min_random_point_distance: float | None = None, preferring_sigma: float = 100, preferring_amplitude: float = 1, preferred_region_tree: KDTree | None = None, use_terminal_penalty: bool = False)¶
Bases:
objectClass to store the parameters needed for graph creation.
- random_point_bbox_buffer¶
The distance used to add a buffer around the bbox of the points.
- Type:
- use_orientation_penalty¶
If set to True, a penalty is added to edges whose direction is not radial.
- Type:
- use_depth_penalty¶
If set to True, a penalty is added to edges whose direction is not parallel to the iso-depth curves.
- Type:
- preferred_regions¶
The list of brain regions in which edge weights are divided by the preferring factor.
- preferred_region_min_random_point_distance¶
The min distance used to pick random points in preferred regions.
- Type:
float | None
- preferring_sigma¶
The sigma used to compute the preferring factor for the given regions.
- Type:
- preferring_amplitude¶
The amplitude used to compute the preferring factor for the given regions.
- Type:
- preferred_region_tree¶
The KDTree object containing the preferred region points.
- Type:
scipy.spatial._kdtree.KDTree | None
- use_terminal_penalty¶
If set to True, a penalty is added to edges that are connected to a terminal.
- Type:
- compute_region_tree(atlas: AtlasHelper, *, force: bool = False)¶
Compute the preferred region tree using the given Atlas.
- load_region_tree_from_file(file)¶
Get the preferred region tree from a file.
- pick_preferred_region_random_points(rng=None, max_tries: int = 10)¶
Create random points in preferred regions with min distance between them.
- property preferred_region_min_distance¶
Get the min distance used to generate random points in the preferred regions.
- axon_synthesis.synthesis.main_trunk.create_graph.one_graph(source_coords: ndarray, target_points: DataFrame, config: CreateGraphConfig, depths: VoxelData | None = None, *, forbidden_regions: VoxelData | None = None, output_path: str | PathLike | None = None, figure_path: str | PathLike | None = None, rng: None | int | Sequence[int] | SeedSequence | BitGenerator | Generator = None, logger: Logger | LoggerAdapter | None = None)¶
Create the nodes and edges for one axon based on the target points and the atlas.