2.3. ECT on Graphs

class ect.ect_graph.ECT(directions=None, num_dirs=None, num_thresh=None, bound_radius=None, thresholds=None, dtype=<class 'numpy.int32'>)[source]

A class to calculate the Euler Characteristic Transform (ECT) from an input EmbeddedGraph or EmbeddedCW.

The result is a matrix where entry M[i,j] is \(\chi(K_{a_i})\) for the direction \(\omega_j\) where \(a_i\) is the ith entry in self.thresholds, and \(\omega_j\) is the ith entry in self.thetas.

Attributes
num_dirs (int):

The number of directions to consider in the matrix.

num_thresh (int):

The number of thresholds to consider in the matrix.

directions (Directions):

The directions to consider for projection.

bound_radius (float):

Either None, or a positive radius of the bounding circle.

__init__(directions=None, num_dirs=None, num_thresh=None, bound_radius=None, thresholds=None, dtype=<class 'numpy.int32'>)[source]

Initialize ECT calculator with either a Directions object or sampling parameters

Parameters:
  • directions – Optional pre-configured Directions object

  • num_dirs – Number of directions to sample (ignored if directions provided)

  • num_thresh – Number of threshold values (required if directions not provided)

  • bound_radius – Optional radius for bounding circle

  • thresholds – Optional array of thresholds

  • dtype – Data type for output array

calculate(graph, theta=None, override_bound_radius=None)[source]

Calculate Euler Characteristic Transform (ECT) for a given graph and direction theta

Parameters:
  • graph (EmbeddedGraph/EmbeddedCW) – The input graph to calculate the ECT for.

  • theta (float) – The angle in \([0,2\pi]\) for the direction to calculate the ECT.

  • override_bound_radius (float) – If None, uses the following in order: (i) the bounding radius stored in the class; or if not available (ii) the bounding radius of the given graph. Otherwise, should be a positive float \(R\) where the ECC will be computed at thresholds in \([-R,R]\). Default is None.

static shape_descriptor(simplex_counts_list)[source]

Calculate shape descriptor from simplex counts (Euler characteristic)