- navis.persistence_points(x, descriptor='root_dist', remove_cbf=False)¶
Calculate points for a persistence diagram.
Based on Li et al., PLoS One (2017). Briefly, this cuts the neuron into linear segments, the start (birth) and end (death) of which are assigned a value (see
descriptorparameter). In combination, these points represent a fingerprint for the topology of the neuron.
descriptor ('root_dist') –
Descriptor function used to calculate birth and death “time” of the segments:
root_distdistance from root
remove_cbf (bool) – In unipolar neurons (e.g. in insects) the soma is separate and connects to the neuron’s backbone via “cell body fiber” (CBF). The length of the CBF can vary quite a bit. Discounting the CBF can make the persistence points more stable. If
remove_cbf=Trueand the neuron has a soma (!) we ignore the CBF for the birth & death times. Neurons will also be automatically be rooted onto their soma!
parallel (bool) – If True and input is NeuronList, use parallel processing. Requires pathos.
n_cores (int, optional) – Numbers of cores to use if
parallel=True. Defaults to half the available cores.
progress (bool) – Whether to show a progress bar. Overruled by
omit_failures (bool) – If True will omit failures instead of raising an exception. Ignored if input is single neuron.
- Return type:
>>> import navis >>> n = navis.example_neurons(1) >>> n.reroot(n.soma, inplace=True) >>> p = navis.persistence_points(n)
Li Y, Wang D, Ascoli GA, Mitra P, Wang Y (2017) Metrics for comparing neuronal tree shapes based on persistent homology. PLOS ONE 12(8): e0182184. https://doi.org/10.1371/journal.pone.0182184