axon_synthesis.inputs.clustering.utils

Some utils for clustering.

Functions

clusters_basic_tuft(config_name, axon_id, ...)

Create one cluster with all points of the group.

common_path(graph, nodes[, source, ...])

Compute the common paths of the given nodes.

compute_common_section_properties(...)

Compute basic properties of the given section.

compute_mean_tuft_length(volume, n_pot, ...)

Compute properties for the cluster.

compute_shortest_paths(directed_graph[, ...])

Compute the shortest paths using an attribute mapping.

create_clustered_morphology(morph, ...[, suffix])

Create a new morphology with the kept path and add new sections to cluster centers.

create_tuft_morphology(morph, tuft_node_ids, ...)

Create a new morphology containing only the given tuft.

export_morph(root_path, morph_name, morph, ...)

Export the given morphology to the given path.

extend_validator_with_default(validator_class)

Extend a validator to automatically set default values during validation.

get_barcode(morph[, metric, tree_index])

Compute the barcode of the given morphology.

reduce_clusters(group, group_path, ...[, ...])

Reduce clusters to one section from their common ancestors to their centers.

resize_root_section(tuft_morph, tuft_orientation)

Resize the root section to 1um.

tuft_morph_path(root_path, group_name, ...)

Create a tuft file path according to the group name, axon ID and cluster ID.

axon_synthesis.inputs.clustering.utils.clusters_basic_tuft(config_name, axon_id, group_name, group_path, group, nodes, **_kwargs)

Create one cluster with all points of the group.

axon_synthesis.inputs.clustering.utils.common_path(graph, nodes, source=None, shortest_paths=None) list[int]

Compute the common paths of the given nodes.

Source should be given only if the graph if undirected. Shortest paths can be given if they were already computed before.

Warning

The graph must have only one component.

axon_synthesis.inputs.clustering.utils.compute_common_section_properties(first_axon_pt, section, n_pot, volume, fraction, strength, bouton_density)

Compute basic properties of the given section.

axon_synthesis.inputs.clustering.utils.compute_mean_tuft_length(volume, n_pot, fraction, strength, bouton_density)

Compute properties for the cluster.

axon_synthesis.inputs.clustering.utils.compute_shortest_paths(directed_graph, attribute_name=None, source=-1)

Compute the shortest paths using an attribute mapping.

axon_synthesis.inputs.clustering.utils.create_clustered_morphology(morph, group_name, axon_id, kept_path, sections_to_add, suffix=None)

Create a new morphology with the kept path and add new sections to cluster centers.

axon_synthesis.inputs.clustering.utils.create_tuft_morphology(morph, tuft_node_ids, common_ancestor_section_id, cluster_common_path, nodes_to_section_ids, shortest_paths)

Create a new morphology containing only the given tuft.

axon_synthesis.inputs.clustering.utils.export_morph(root_path, morph_name, morph, morph_type, suffix='', logger=None)

Export the given morphology to the given path.

axon_synthesis.inputs.clustering.utils.extend_validator_with_default(validator_class) Validator

Extend a validator to automatically set default values during validation.

axon_synthesis.inputs.clustering.utils.get_barcode(morph, metric='path_distance', tree_index=0)

Compute the barcode of the given morphology.

axon_synthesis.inputs.clustering.utils.reduce_clusters(group, group_path, group_name, morph, axon, axon_id, cluster_df, directed_graph, nodes, sections_to_add, morph_paths, cluster_props: list[tuple], shortest_paths: dict, bouton_density: float | None, brain_regions: VoxelData | None = None, atlas_region_id: int | None = None, atlas_orientations: OrientationField | None = None, projection_pop_numbers: DataFrame | None = None, export_tuft_morph_dir: str | PathLike | None = None, config_name: str | None = None, rng: None | int | Sequence[int] | SeedSequence | BitGenerator | Generator = None, logger: Logger | LoggerAdapter | None = None) set[int]

Reduce clusters to one section from their common ancestors to their centers.

axon_synthesis.inputs.clustering.utils.resize_root_section(tuft_morph, tuft_orientation, root_section_idx=0)

Resize the root section to 1um.

axon_synthesis.inputs.clustering.utils.tuft_morph_path(root_path, group_name, axon_id, tuft_id)

Create a tuft file path according to the group name, axon ID and cluster ID.