  
  [1m[4m[31m21. Topological Data Analysis[0m
  
      | [22m[32m MatrixToTopologicalSpace(A,n)[0m 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.                                                                                                                               | 
      | [22m[32m ReadImageAsTopologicalSpace("file.png",n)[0m [22m[32m ReadImageAsTopologicalSpace("file.png",[m,n])[0m 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].      | 
      | [22m[32m ReadImageAsMatrix("file.png")[0m 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.                                                                                                                                                              | 
      | [22m[32m WriteTopologicalSpaceAsImage(T,"filename","ext")[0m 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.                                                                                                                                            | 
      | [22m[32m ViewTopologicalSpace(T)[0m [22m[32m ViewTopologicalSpace(T,"mozilla")[0m Inputs a topological space T, and optionally a command such as "mozilla" for viewing image files. A black/white image is displayed.                                                                                                                                                                | 
      | [22m[32m BettiNumbers(T,n)[0m [22m[32m BettiNumbers(T)[0m 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.                                                                                                                                              | 
      | [22m[32m PathComponent(T,n)[0m 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.                                                                                                                                                                                      | 
      | [22m[32m SingularChainComplex(A)[0m 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.                                                                                                                                                                                | 
      | [22m[32m ContractTopologicalSpace(T)[0m 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.                                                                                      | 
      | [22m[32m BoundaryTopologicalSpace(T)[0m Inputs a topological space T and returns its boundars as a topological space.                                                                                                                                                                                                                                                     | 
      | [22m[32m BoundarySingularities(T)[0m 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.   | 
      | [22m[32m ThickenedTopologicalSpace(T)[0m [22m[32m ThickenedTopologicalSpace(T,n)[0m 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. | 
      | [22m[32m ComplementTopologicalSpace(T)[0m 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.                                                                                                                                                                                                 | 
      | [22m[32m ConcatenatedTopologicalSpace(L)[0m 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)].                                                                                                                             | 
  
