Topological Data Analysis

MatrixToTopologicalSpace
MatrixToTopologicalSpace(A,n)

Inputs an integer matrix A and an integer n. It returns a 2-dimensional topological space corresponding to the black/white image determined by the threshold n and the values of the pixels in A.
ReadImageAsTopologicalSpace
ReadImageAsTopologicalSpace("file.png",n)
ReadImageAsTopologicalSpace("file.png",[m,n])

Reads an image file ("file.png", "file.eps", "file.bmp" etc) and an integer n or pair [m,n] of integers between 0 and 765. It returns a topological space based on the black/white version of the image determined by the threshold n or threshold range [m,n].
ReadImageAsMatrix
ReadImageAsMatrix("file.png")

Reads an image file ("file.png", "file.eps", "file.bmp" etc) and returns an integer matrix whose entries are the sum of the RGB values of the pixels in the image.
WriteTopologicalSpaceAsImage
WriteTopologicalSpaceAsImage(T,"filename","ext")

Inputs a 2-dimensional topological space T, and a filename followed by its extension (e.g. "myfile" followed by "png"). A black/white image is saved to the file.

ViewTopologicalSpace
ViewTopologicalSpace(T)
ViewTopologicalSpace(T,"mozilla")

Inputs a topological space T, and optionally a command such as "mozilla" for viewing image files. A black/white image is displayed.
Bettinumbers
Bettinumbers(T,n)
Bettinumbers(T)

Inputs a topological space T and a non-negative integer n. It returns the n-th betti number of T. If the integer n is not input then a list of all betti numbers is returned.
PathComponent
PathComponent(T,n)

Inputs a topological space T and an integer n in the rane 0, ..., Bettinumbers(T,0) . It returns the n-th path component of T as a topological space.
SingularChainComplex
SingularChainComplex(T)

Inputs a topological space T and returns a (usually very large) integral chain complex that is homotopy equivalent to the singular chain complex of T.

ContractTopologicalSpace
ContractTopologicalSpace(T)

Inputs a topological space T of dimension d and removes d-dimensional cells from T without changing the homotopy type of T. When the function has been applied, no further d-cells can be removed from T without changing the homotopy type.

BoundaryTopologicalSpace
BoundaryTopologicalSpace(T)

Inputs a topological space T and returns its boundars as a topological space.

BoundarySingularities
BoundarySingularities(T)

Inputs a topological space T and returns the subspace of points in the boundary where the boundary is not differentiable. (The method for deciding differentiability at a point is crude/discrete and prone to errors.) The zeroth betti number of the set of points is a measure of the number of "corners" in the boundary of T.

ThickenedTopologicalSpace
ThickenedTopologicalSpace(T)
ThickenedTopologicalSpace(T,n)

Inputs a topological space T and returns a topological space S. If a euclidean point is in T then this point and all its perpendicularly neighbouring euclidean points are included in S.

If a positive integer n is input as a second argument then the thickening process is repeated n times.

ComplementTopologicalSpace
ComplementTopologicalSpace(T)

Inputs a topological space T and returns a topological space S. A euclidean point is in S precisely when the point is not in T.

ConcatenatedTopologicalSpace
ConcatenatedTopologicalSpace(L)

Inputs a list L of topological spaces whose underlying arrays of numbers all have equal dimensions. It returns a topological space T got by juxtaposing the spaces L[1], L[2], ..., L[Length(L)].