axon_synthesis.synthesis.main_trunk.create_graph.utils

Some utils for graph creation.

Module Attributes

FORCE_2D

Force the Voronoï and Delaunay calculations to ignore the Z coordinate.

Functions

add_bounding_box_pts(all_pts)

Add points of the bbox.

add_depth_penalty(edges_df, from_coord_cols, ...)

Add penalty to edges according to their depth in the Atlas.

add_intermediate_points(pts, ref_coords, ...)

Add intermediate points between source points and target points.

add_orientation_penalty(edges_df, ...)

Add penalty to edges according to their orientation.

add_preferred_reward(edges_df, ...)

Add rewards to edges depending on their distance to the preferred points.

add_random_points(all_pts, ...[, max_tries, ...])

Add random points in the bounding box of the given points.

add_terminal_penalty(edges, nodes)

Add penalty to edges to ensure the Steiner algorithm don't connect terminals directly.

add_voronoi_points(all_pts, voronoi_steps[, ...])

Add Voronoi points between the given points.

create_edges(all_points, from_coord_cols, ...)

Create undirected edges from the Delaunay triangulation of the given points.

drop_close_points(all_points_df, ...[, logger])

Drop points that are closer to a given distance.

drop_outside_points(all_points_df[, ...])

Remove points outside the bounding box of reference points or brain regions.

generate_random_points(bbox, ...[, ...])

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.