PersistentHomologyTransfer.jl

Persistent Homology Transform is produced and maintained by
Yossi Bokor and Katharine Turner
and

This package provides an implementation of the Persistent Homology Transform, as defined in Persistent Homology Transform for Modeling Shapes and Surfaces.

Installation

Currently, the best way to install PersistentHomologyTransfer is to run the following in Julia:

using Pkg
Pkg.add(PersistentHomologyTransfer)

Inputs

PHT computes the Persistent Homology Transform of simple, closed curves in \(\mathbb{R}^2\) given an \(m \times 2\) CSV file of ordered points sample from the curve in either a clockwise or anti-clockwise direction. You can either specify the directions explicity as a \(n \times 2\) array (directions::Array{Float64}(n,2)), or specify an integer (directions::Int64) and then the directions used will be generated by

angles = [n*pi/(directions/2) for n in 1:directions]
directions = [[cos(x), sin(x)] for x in angles]

To perform the Persistent Homology Transfer for the directions, run

PHT(points, directions)

This outputs an array of Eirene Persistence Diagrams, one for each direction.

Example

We will go through an example using a random shape and 20 directions. You can download the CSV file from here

To begin, load the CSV file into an array in Julia

Boundary = CSV.read("<path/to/file>")
Persistence_Diagrams = PHT(Boundary, 20)

You can then access the persistence diagram corresponding to the \(i^{th}\) direction as

Persistence_Diagrams[i]