axon_synthesis.inputs.clustering¶
Cluster the terminal points of a morphology to define a main truk and a set of tufts.
Functions
|
Compute the cluster of all morphologies of the given directory. |
|
Run clustering on one morphology. |
|
Export cluster data. |
|
Add a 'morphology' column in the given DataFrame computed from the 'morph_file' column. |
|
Map nodes to terminals. |
Classes
|
The class to store Clustering data. |
|
Class to store clustering result for one morphology. |
- class axon_synthesis.inputs.clustering.Clustering(path: str | PathLike, parameters: dict, **kwargs)¶
Bases:
BasePathBuilderThe class to store Clustering data.
- create_tree()¶
Create the associated directories.
- classmethod load(path: str | PathLike, file_selection: FILE_SELECTION = FILE_SELECTION.NONE, *, allow_missing: bool = False, **kwargs) Self¶
Load the clustering data from a given directory.
- property parameters¶
Return the parameters used for clustering.
- plot_cluster_properties()¶
Plot cluster properties.
- save()¶
Save the clustering data to the associated path.
- class axon_synthesis.inputs.clustering.ClusteringResult(trunk_props, cluster_props, all_terminal_points, morph_paths)¶
Bases:
objectClass to store clustering result for one morphology.
- save(**kwargs)¶
Save internals to a temporary directory.
- axon_synthesis.inputs.clustering.cluster_morphologies(morph_dir: str | PathLike, clustering_parameters: dict, output_path: str | PathLike, *, atlas: AtlasHelper | None, wmr: WhiteMatterRecipe | None, pop_neuron_numbers: DataFrame | None, bouton_density: float | None, debug: bool = False, rng: None | int | Sequence[int] | SeedSequence | BitGenerator | Generator = None, parallel_config: ParallelConfig | None = None) Clustering¶
Compute the cluster of all morphologies of the given directory.
- axon_synthesis.inputs.clustering.cluster_one_morph(morph_path: str | PathLike, clustering: Clustering, atlas: AtlasHelper | None, wmr: WhiteMatterRecipe | None, projection_pop_numbers: DataFrame | None, bouton_density: float | None, *, morph_name: str | None = None, debug: bool = False, rng: None | int | Sequence[int] | SeedSequence | BitGenerator | Generator = None, parallel_config: ParallelConfig | None = None)¶
Run clustering on one morphology.
- axon_synthesis.inputs.clustering.export_clusters(clustering, trunk_props, cluster_props, all_terminal_points, morph_paths, *, debug=False)¶
Export cluster data.
- axon_synthesis.inputs.clustering.extract_morph_name_from_filename(df, file_col='morph_file', name_col='morphology')¶
Add a ‘morphology’ column in the given DataFrame computed from the ‘morph_file’ column.
- axon_synthesis.inputs.clustering.nodes_to_terminals_mapping(graph, shortest_paths)¶
Map nodes to terminals.