axon_synthesis.synthesis.main_trunk.post_process¶
Post-process the Steiner solutions.
Functions
|
Check if a next target can be selected and return it. |
|
Compute the closest point on a line from a given point. |
|
Compute the direction and distance between 2 points. |
|
Compute the direction for one step. |
|
Export morphology and figure. |
|
Gather the sections with unifurcations. |
|
Return 3-d coordinates of a new random point. |
|
Returns a combination of the segments history. |
|
Plot the morphology after post-processing. |
|
Post-process a trunk of the given morphology. |
|
Perform a random walk guided by intermediate points. |
|
Resample the diameters on the new points. |
|
Compute the weights depending on the lengths. |
Classes
|
Class to store the parameters needed for long-range trunk post-processing. |
- class axon_synthesis.synthesis.main_trunk.post_process.PostProcessConfig(skip: bool = False, history_path_length: float | None = None, default_history_path_length_coeff: float = 5, global_target_coeff: float = 0, global_target_sigma_coeff: float = 10, target_coeff: float = 2, target_sigma_coeff: float = 2, random_coeff: float = 2, history_coeff: float = 2, history_sigma_coeff: float = 2, length_coeff: float = 1, max_random_direction_picks: int = 10)¶
Bases:
objectClass to store the parameters needed for long-range trunk post-processing.
- default_history_path_length_coeff¶
The coefficient used to compute the history path length when it is not provided.
- Type:
- axon_synthesis.synthesis.main_trunk.post_process.check_next_target(intermediate_pts, nb_intermediate_pts, target_index, target, target_dist, next_target_index, next_target, min_target_dist, length_norm, default_min_target_dist, logger)¶
Check if a next target can be selected and return it.
- axon_synthesis.synthesis.main_trunk.post_process.closest_seg_pt(pt, seg)¶
Compute the closest point on a line from a given point.
- axon_synthesis.synthesis.main_trunk.post_process.compute_direction(start_pt, end_pt)¶
Compute the direction and distance between 2 points.
- axon_synthesis.synthesis.main_trunk.post_process.compute_step_direction(intermediate_pts, current_pt, target, target_index, next_target, next_target_index, step_length, total_length, config, history_direction, latest_directions, rng=<module 'numpy.random' from '/home/docs/checkouts/readthedocs.org/user_builds/axon-synthesis/conda/stable/lib/python3.12/site-packages/numpy/random/__init__.py'>, logger=None)¶
Compute the direction for one step.
- axon_synthesis.synthesis.main_trunk.post_process.export(morph, initial_morph, output_path, figure_path, logger)¶
Export morphology and figure.
- axon_synthesis.synthesis.main_trunk.post_process.gather_sections(root_section, tuft_barcodes)¶
Gather the sections with unifurcations.
- axon_synthesis.synthesis.main_trunk.post_process.get_random_vector(distance: float = 1.0, norm: float | None = None, std: float | None = None, initial_theta: float | None = None, initial_phi: float | None = None, rng=<module 'numpy.random' from '/home/docs/checkouts/readthedocs.org/user_builds/axon-synthesis/conda/stable/lib/python3.12/site-packages/numpy/random/__init__.py'>) ndarray[Any, dtype[floating]]¶
Return 3-d coordinates of a new random point.
The distance between the produced point and (0,0,0) is given by the ‘distance’ argument.
- axon_synthesis.synthesis.main_trunk.post_process.history(latest_lengths, latest_directions, history_path_length)¶
Returns a combination of the segments history.
- axon_synthesis.synthesis.main_trunk.post_process.plot(morph, initial_morph, figure_path)¶
Plot the morphology after post-processing.
- axon_synthesis.synthesis.main_trunk.post_process.post_process_trunk(morph: Morphology, trunk_section_id: int, trunk_properties: DataFrame, tuft_barcodes: DataFrame, config: PostProcessConfig, *, rng: None | int | Sequence[int] | SeedSequence | BitGenerator | Generator = None, output_path: str | PathLike | None = None, figure_path: str | PathLike | None = None, logger: Logger | LoggerAdapter | None = None)¶
Post-process a trunk of the given morphology.
- axon_synthesis.synthesis.main_trunk.post_process.random_walk(starting_pt: ~collections.abc.Sequence[float] | ~numpy.ndarray[~typing.Any, ~numpy.dtype[~numpy.floating]], intermediate_pts: ~collections.abc.Sequence[~collections.abc.Sequence[float]] | ~numpy.ndarray[~typing.Any, ~numpy.dtype[~numpy.floating]], length_stats: dict[str, float], config: ~axon_synthesis.synthesis.main_trunk.post_process.PostProcessConfig, previous_history: tuple[list[float], list[list[float] | ~numpy.ndarray[~typing.Any, ~numpy.dtype[~numpy.floating]]]] | None = None, *, rng=<module 'numpy.random' from '/home/docs/checkouts/readthedocs.org/user_builds/axon-synthesis/conda/stable/lib/python3.12/site-packages/numpy/random/__init__.py'>, logger: ~logging.Logger | ~logging.LoggerAdapter | None = None) tuple[ndarray[Any, dtype[floating]], tuple[list[float], list[list[float] | ndarray[Any, dtype[floating]]]]]¶
Perform a random walk guided by intermediate points.
- axon_synthesis.synthesis.main_trunk.post_process.resample_diameters(pts, resampled_pts, diams)¶
Resample the diameters on the new points.
- axon_synthesis.synthesis.main_trunk.post_process.weights(lengths, history_path_length)¶
Compute the weights depending on the lengths.