phenotypic.analysis.cubical_persistence#

phenotypic.analysis.cubical_persistence(image: numpy.ndarray, *, filtration: Literal['sublevel', 'superlevel'] = 'superlevel', min_persistence: float = 0.0) PersistencePairsResult[source]#

Compute beta-0 and beta-1 persistence from image top cells.

Pixels are closed, nonperiodic GUDHI top-dimensional cells. Consequently, foreground cells touching at a corner are connected. GUDHI receives the copied image for sublevel persistence and its negation for superlevel persistence. Returned values are always converted back to the original image intensity coordinates.

Parameters:
  • image (numpy.ndarray) – Nonempty, finite, real-valued numeric two-dimensional array.

  • filtration (Literal['sublevel', 'superlevel']) – Either "sublevel" or "superlevel". Defaults to "superlevel" for bright structures.

  • min_persistence (float) – Finite nonnegative lifetime threshold. A finite class is retained only when its lifetime is strictly greater than this value. Essential classes are always retained.

Returns:

Persistence values and top-cell representatives for homology dimensions zero and one.

Raises:
  • ValueError – If an input or parameter violates the frozen contract.

  • ImportError – If the optional GUDHI dependency is unavailable for a valid nonempty call.

Return type:

PersistencePairsResult