Perseus

org.appliedtopology.tda4j.Perseus
object Perseus

Perseus's cubical toplex (dense grid) input format and its persistence-interval output format, as read by GUDHI.

Perseus lists the first axis fastest, the opposite of CubicalImage.fromFlatArray; the readers and writers convert. A value of -1 (a missing cube) is read as NaN: masked, not in the complex, in either direction. Periodic boundaries (negative sizes, a GUDHI extension) are refused.

Perseus's simplicial toplex formats (simtop and nmfsimtop, as described in Perseus's manual) are read and written as lists of facets with birth times; toplexStream makes the filtered complex of such a list.

Attributes

Experimental
true
Source
Perseus.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Perseus.type

Members list

Value members

Concrete methods

def formatCubicalToplex(shape: IndexedSeq[Int], flatValues: IndexedSeq[Double]): String

Attributes

Source
Perseus.scala
def formatNonUniformToplex(facets: Seq[(Double, Simplex[Int])]): String

The nmfsimtop text of facets (one coordinate per vertex).

The nmfsimtop text of facets (one coordinate per vertex).

Attributes

Source
Perseus.scala
def formatPersistenceIntervals(bars: Seq[PersistenceBar[Double, _]]): Map[Int, String]

The text of each dimension's output file, by dimension.

The text of each dimension's output file, by dimension.

Attributes

Source
Perseus.scala
def formatUniformToplex(facets: Seq[(Double, Simplex[Int])]): String

The simtop text of facets (one coordinate per vertex): every facet must have the same dimension.

The simtop text of facets (one coordinate per vertex): every facet must have the same dimension.

Attributes

Source
Perseus.scala
def parseCubicalImageData(text: String, origin: String = ...): (IndexedSeq[Int], IndexedSeq[Double])

The shape and values of a cubical toplex file, converted to the axis order of CubicalImage.fromFlatArray, with -1 read as NaN (masked). Format: the dimension d, d positive sizes, then the values with the first axis fastest.

The shape and values of a cubical toplex file, converted to the axis order of CubicalImage.fromFlatArray, with -1 read as NaN (masked). Format: the dimension d, d positive sizes, then the values with the first axis fastest.

Attributes

Source
Perseus.scala
def parseNonUniformToplex(text: String, origin: String = ...): Seq[(Double, Simplex[Int])]

nmfsimtop: the number n of coordinates per vertex, then for each simplex its own dimension m, its m + 1 vertices and its birth time. As parseUniformToplex otherwise.

nmfsimtop: the number n of coordinates per vertex, then for each simplex its own dimension m, its m + 1 vertices and its birth time. As parseUniformToplex otherwise.

Attributes

Source
Perseus.scala
def parsePersistenceIntervals(text: String, dim: Int): Seq[PersistenceBar[Double, Nothing]]

readPersistenceIntervals on the text of such a file.

readPersistenceIntervals on the text of such a file.

Attributes

Source
Perseus.scala
def parseUniformToplex(text: String, origin: String = ...): Seq[(Double, Simplex[Int])]

simtop: the dimension d of every simplex, the number n of coordinates per vertex, then for each simplex its d + 1 vertices (n numbers each, in any order) and its integer birth time. A simplex with birth time -1 is ignored. With n == 1 the vertices are the numbers themselves; otherwise they are numbered in the order they first appear. Faces are not listed: each is born with the earliest facet that contains it (toplexStream).

simtop: the dimension d of every simplex, the number n of coordinates per vertex, then for each simplex its d + 1 vertices (n numbers each, in any order) and its integer birth time. A simplex with birth time -1 is ignored. With n == 1 the vertices are the numbers themselves; otherwise they are numbered in the order they first appear. Faces are not listed: each is born with the earliest facet that contains it (toplexStream).

Attributes

Source
Perseus.scala
def readCubicalImageData(path: String): (IndexedSeq[Int], IndexedSeq[Double])

Attributes

Source
Perseus.scala
def readCubicalToplex(path: String, sublevel: Boolean = ..., nanMask: Boolean = ...): CubicalGridStream

The toplex of path as a grid; with nanMask = false a missing cube (-1, read as NaN) is an error.

The toplex of path as a grid; with nanMask = false a missing cube (-1, read as NaN) is an error.

Attributes

Source
Perseus.scala
def readNonUniformToplex(path: String): Seq[(Double, Simplex[Int])]

Attributes

Source
Perseus.scala
def readPersistenceIntervals(path: String, dim: Int): Seq[PersistenceBar[Double, Nothing]]

Reads one Perseus output file (_.txt) back into bars of the given dimension -- dim must be supplied by the caller, since Perseus's own per-dimension output files don't repeat it inside the file.

Reads one Perseus output file (_.txt) back into bars of the given dimension -- dim must be supplied by the caller, since Perseus's own per-dimension output files don't repeat it inside the file.

Attributes

Source
Perseus.scala
def readUniformToplex(path: String): Seq[(Double, Simplex[Int])]

Attributes

Source
Perseus.scala
def toplexStream(facets: Seq[(Double, Simplex[Int])]): ExplicitStream[Int, Double]

The filtered complex generated by facets: each facet enters at its birth time, each face at the earliest birth of the facets that contain it (Perseus lowers a face's birth to its parent's in the same way).

The filtered complex generated by facets: each facet enters at its birth time, each face at the earliest birth of the facets that contain it (Perseus lowers a face's birth to its parent's in the same way).

Attributes

Source
Perseus.scala
def writeCubicalToplex(path: String, shape: IndexedSeq[Int], flatValues: IndexedSeq[Double]): Unit

shape/flatValues in CubicalImage.fromFlatArray's own last-axis-fastest convention -- reversed internally to Perseus's own first-axis-fastest convention before writing. Double.NaN (masked) is written as -1. An infinite value is refused: the format has none, and -1 would read back as a mask.

shape/flatValues in CubicalImage.fromFlatArray's own last-axis-fastest convention -- reversed internally to Perseus's own first-axis-fastest convention before writing. Double.NaN (masked) is written as -1. An infinite value is refused: the format has none, and -1 would read back as a mask.

Attributes

Source
Perseus.scala
def writePersistenceIntervals(pathPrefix: String, bars: Seq[PersistenceBar[Double, _]]): Unit

Perseus's own output convention: one file per dimension (_.txt), two whitespace-separated integer columns per line, birth death -- a death of -1 means the class is essential. Perseus's own birth/death values are filtration STEP indices (integers), not raw filtration values -- this writer rounds whatever Doubles it's given to their nearest integer; callers wanting genuine step-index semantics should convert their own filtration values to step indices first.

Perseus's own output convention: one file per dimension (_.txt), two whitespace-separated integer columns per line, birth death -- a death of -1 means the class is essential. Perseus's own birth/death values are filtration STEP indices (integers), not raw filtration values -- this writer rounds whatever Doubles it's given to their nearest integer; callers wanting genuine step-index semantics should convert their own filtration values to step indices first.

Attributes

Source
Perseus.scala