axon_synthesis.synthesis.main_trunk.create_graph.utils¶
Some utils for graph creation.
Module Attributes
Force the Voronoï and Delaunay calculations to ignore the Z coordinate. |
Functions
|
Add points of the bbox. |
|
Add penalty to edges according to their depth in the Atlas. |
|
Add intermediate points between source points and target points. |
|
Add penalty to edges according to their orientation. |
|
Add rewards to edges depending on their distance to the preferred points. |
|
Add random points in the bounding box of the given points. |
|
Add penalty to edges to ensure the Steiner algorithm don't connect terminals directly. |
|
Add Voronoi points between the given points. |
|
Create undirected edges from the Delaunay triangulation of the given points. |
|
Drop points that are closer to a given distance. |
|
Remove points outside the bounding box of reference points or brain regions. |
|
Generate random points in a bounding box and with a min distance. |
- axon_synthesis.synthesis.main_trunk.create_graph.utils.FORCE_2D = False¶
Force the Voronoï and Delaunay calculations to ignore the Z coordinate.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.add_bounding_box_pts(all_pts: ndarray)¶
Add points of the bbox.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.add_depth_penalty(edges_df, from_coord_cols, to_coord_cols, depths, sigma, amplitude)¶
Add penalty to edges according to their depth in the Atlas.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.add_intermediate_points(pts: ndarray, ref_coords, min_intermediate_distance, intermediate_number)¶
Add intermediate points between source points and target points.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.add_orientation_penalty(edges_df, from_coord_cols, to_coord_cols, soma_center_coords, orientation_penalty_exponent, amplitude)¶
Add penalty to edges according to their orientation.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.add_preferred_reward(edges_df, from_coord_cols, to_coord_cols, preferred_region_tree, sigma, amplitude)¶
Add rewards to edges depending on their distance to the preferred points.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.add_random_points(all_pts: ndarray, min_random_point_distance: float | None, bbox_buffer: float, rng: None | int | Sequence[int] | SeedSequence | BitGenerator | Generator, *, max_tries: int = 10, logger: Logger | LoggerAdapter | None = None)¶
Add random points in the bounding box of the given points.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.add_terminal_penalty(edges, nodes)¶
Add penalty to edges to ensure the Steiner algorithm don’t connect terminals directly.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.add_voronoi_points(all_pts: ndarray, voronoi_steps: int, initial_bbox: ndarray | None = None, logger: Logger | LoggerAdapter | None = None)¶
Add Voronoi points between the given points.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.create_edges(all_points, from_coord_cols, to_coord_cols)¶
Create undirected edges from the Delaunay triangulation of the given points.
Note
The source-target order has no meaning.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.drop_close_points(all_points_df: DataFrame, duplicate_precision: float, logger: Logger | LoggerAdapter | None = None)¶
Drop points that are closer to a given distance.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.drop_outside_points(all_points_df, ref_pts=None, bbox=None)¶
Remove points outside the bounding box of reference points or brain regions.
- axon_synthesis.synthesis.main_trunk.create_graph.utils.generate_random_points(bbox: ndarray, min_random_point_distance: float, rng: None | int | Sequence[int] | SeedSequence | BitGenerator | Generator, *, existing_pts_tree: KDTree | None = None, max_tries: int = 10)¶
Generate random points in a bounding box and with a min distance.