tmd.Topology.methods

TMD Topology algorithms implementation.

Functions

extract_connectivity_from_points(tree[, ...])

Extract connectivity from list of points.

extract_ph(tree[, feature, output_file, sort])

Extracts persistent homology from tree.

extract_ph_neuron(neuron[, feature, ...])

Extracts persistent homology from tree.

get_lifetime(tree[, feature])

Returns the sequence of birth - death times for each section.

get_persistence_diagram(tree[, feature])

Method to extract ph from tree that contains mutlifurcations.

get_ph_angles(tree[, feature])

Method to extract ph from tree that contains mutlifurcations.

get_ph_neuron(neuron[, feature, neurite_type])

Method to extract ph from a neuron that contains mutlifurcations.

get_ph_radii(tree[, feature])

Returns the ph diagram enhanced with the corresponding encoded radii.

tree_to_property_barcode(tree, ...[, ...])

Decompose a tree data structure into a barcode.

write_ph(ph[, output_file])

Writes a persistence diagram in an output file.

tmd.Topology.methods.extract_connectivity_from_points(tree, threshold=1.0)

Extract connectivity from list of points.

tmd.Topology.methods.extract_ph(tree, feature='radial_distances', output_file='test.txt', sort=False, **kwargs)

Extracts persistent homology from tree.

tmd.Topology.methods.extract_ph_neuron(neuron, feature='radial_distances', output_file=None, neurite_type='all', sort=False, **kwargs)

Extracts persistent homology from tree.

tmd.Topology.methods.get_lifetime(tree, feature='point_radial_distances')

Returns the sequence of birth - death times for each section.

This can be used as the first step for the approximation of P.H. of the radial distances of the neuronal branches.

tmd.Topology.methods.get_persistence_diagram(tree, feature='radial_distances', **kwargs)

Method to extract ph from tree that contains mutlifurcations.

tmd.Topology.methods.get_ph_angles(tree, feature='radial_distances', **kwargs)

Method to extract ph from tree that contains mutlifurcations.

tmd.Topology.methods.get_ph_neuron(neuron, feature='radial_distances', neurite_type='all', **kwargs)

Method to extract ph from a neuron that contains mutlifurcations.

tmd.Topology.methods.get_ph_radii(tree, feature='radial_distances', **kwargs)

Returns the ph diagram enhanced with the corresponding encoded radii.

tmd.Topology.methods.tree_to_property_barcode(tree, filtration_function, property_class=<class 'tmd.Topology.persistent_properties.NoProperty'>)

Decompose a tree data structure into a barcode.

Each bar in the barcode is optionally linked with a property determined by property_class.

Parameters:
  • filtration_function (Callable[tree] -> np.ndarray) – The filtration function to apply on the tree

  • property_class (PersistentProperty, optional) – A PersistentProperty class.By default the NoProperty is used which does not add entries in the barcode.

Returns:

A list of bars [bar1, bar2, …, barN], where each bar is a
list of:
  • filtration value start

  • filtration value end

  • property_value1

  • property_value2

  • property_valueN

bars_to_points: A list of point ids for each bar in the barcode. Each list

corresponds to the set of endpoints (i.e. the end point of each section) that belong to the corresponding persistent component - or bar.

Return type:

barcode (list)

tmd.Topology.methods.write_ph(ph, output_file='test.txt')

Writes a persistence diagram in an output file.