navis.persistence_distances¶
- navis.persistence_distances(q, t=None, scores='mean', augment=True, bw=0.2, **persistence_kwargs)[source]¶
Calculate morphological similarity using persistence diagrams.
- This works by:
Generate persistence points for each neuron.
Create a weighted Gaussian from persistence points and sample 100 evenly spaced points to create a feature vector.
Calculate Euclidean distance.
- Parameters:
q/t (NeuronList) – Queries and targets, respectively. If
t=None
will run queries against queries. Neurons should have the same units, ideally nanometers.scores ("forward" | "reverse" | "mean") –
bw (float) – Bandwidth for Gaussian kernel: larger = smoother, smaller = more detailed.
augment (bool) – Whether to augment the persistence vectors with other neuron properties (number of branch points & leafs and cable length).
**persistence_kwargs – Keyword arguments are passed to
navis.persistence_points()
.
- Returns:
distances
- Return type:
pandas.DataFrame
See also
navis.persistence_points()
The function to calculate the persistence points.
navis.persistence_vectors()
Use this to get and inspect the actual vectors used here.