  
  [1m[4m[31m20. Topological Data Analysis[0m
  
      | [22m[32m ReadImageFile("file.png",n)[0m Inputs an image file ("file.png", "file.eps", "file.bmp" etc) and an integer n between 0 and 765. It returns a 1/0 integer matrix representing a black/white version of the image determined by the threshold n.                                                                                                                                                                                                                                                          | 
      | [22m[32m BettiNumbersOfMatrix(A)[0m Inputs a 1/0 integer matrix A representing a black/white version of an image. It returns a list [b0,b1] where b0 is the zeroth betti number of the black image space, and b1 is the first betti number. All higher betti numbers will be zero as the space is 2-dimensional.                                                                                                                                                                                                  | 
      | [22m[32m MatrixToChainComplex(A)[0m Inputs a 1/0 integer matrix A representing a black/white version of an image and returns the cellular chain complex of the black image space (in characteristic 0).                                                                                                                                                                                                                                                                                                           | 
      | [22m[32m ContractMatrix(A)[0m Inputs a 1/0 integer matrix A representing a black/white version of an image and modifies A so that it represents a homotopy equivalent image space hopefully with fewer black cells. Black cells are removed from the image to produce a homotopy equivalent image from which no further black cell can be removed without changing the homotopy type. The function returns true if it succeeds in reducing the number of cells of the original image; otherwise it returns false. | 
      | [22m[32m ThickenedMatrix(A)[0m [22m[32m ThickenedMatrix(A,n)[0m Inputs a 1/0 integer matrix A and returns a 1/0 matrix B. If an entry in A is equal to 1 then the corresponding entry in B and all eight neighbouring entries in B are equal to 1. If a positive integer n is input as a second argument then the thickening process is repeated n times.                                                                                                                                                                    | 
  
