CubicalImage

org.appliedtopology.tda4j.CubicalImage
object CubicalImage

Cubical complexes of images and voxel grids. Every array constructor reduces to fromFlatArray: values in row-major order (last axis fastest) and a shape.

sublevel = true (the default, as in GUDHI, DIPHA and Perseus) filters by the values; sublevel = false by the negated values, so bars of a superlevel filtration are reported in negated units. Voxel data of any file format is loaded into an array first. A pixel of value Double.NaN is masked (missing data): it is not in the complex, in a sublevel and a superlevel image alike (NaN has no sign). Infinite values are ordinary values: +Infinity enters after every finite value in a sublevel image, and before them in a superlevel one (negated to -Infinity). Every array constructor takes nanMask = false to turn masks off: a NaN pixel is then an error, naming the pixel.

Attributes

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

Members list

Value members

Concrete methods

def fromFlatArray(shape: IndexedSeq[Int], flatValues: IndexedSeq[Double], sublevel: Boolean = ..., parallelFiltrationValue: Boolean = ..., nanMask: Boolean = ...): CubicalGridStream

Dense n-dimensional grid from a flat, row-major array of values and an explicit shape -- e.g. for shape = IndexedSeq(n0, n1, n2), index (i0, i1, i2) reads flatValues(i0*n1*n2 + i1*n2 + i2), the same convention Array[Array[...]].flatten produces, so fromGrayscale2D/fromVoxelGrid3D below can just flatten and delegate here.

Dense n-dimensional grid from a flat, row-major array of values and an explicit shape -- e.g. for shape = IndexedSeq(n0, n1, n2), index (i0, i1, i2) reads flatValues(i0*n1*n2 + i1*n2 + i2), the same convention Array[Array[...]].flatten produces, so fromGrayscale2D/fromVoxelGrid3D below can just flatten and delegate here.

Attributes

Source
CubicalImage.scala
def fromGrayscale2D(pixels: Array[Array[Double]], sublevel: Boolean = ..., parallelFiltrationValue: Boolean = ..., nanMask: Boolean = ...): CubicalGridStream

pixels(i)(j) as a dense 2D grid, shape (pixels.length, pixels(0).length).

pixels(i)(j) as a dense 2D grid, shape (pixels.length, pixels(0).length).

Attributes

Source
CubicalImage.scala
def fromVoxelGrid3D(voxels: Array[Array[Array[Double]]], sublevel: Boolean = ..., parallelFiltrationValue: Boolean = ..., nanMask: Boolean = ...): CubicalGridStream

voxels(i)(j)(k) as a dense 3D grid, shape (voxels.length, voxels(0).length, voxels(0)(0).length).

voxels(i)(j)(k) as a dense 3D grid, shape (voxels.length, voxels(0).length, voxels(0)(0).length).

Attributes

Source
CubicalImage.scala

Inherited methods

def fromBufferedImage(img: BufferedImage, sublevel: Boolean = ..., parallelFiltrationValue: Boolean = ...): CubicalGridStream

img.getRGB(x, y) grayscale (luma) values as a dense grid, shape (width, height) -- axis 0 is the image's own x-axis, axis 1 is y.

img.getRGB(x, y) grayscale (luma) values as a dense grid, shape (width, height) -- axis 0 is the image's own x-axis, axis 1 is y.

Attributes

Inherited from:
CubicalImagePlatform (hidden)
Source
CubicalImagePlatform.scala
def fromFile(path: String, sublevel: Boolean = ..., parallelFiltrationValue: Boolean = ...): CubicalGridStream

Reads an image file via javax.imageio.ImageIO (JDK-builtin, no new dependency) -- PNG/JPEG/BMP/GIF and whatever other formats the running JVM's registered ImageReaders support.

Reads an image file via javax.imageio.ImageIO (JDK-builtin, no new dependency) -- PNG/JPEG/BMP/GIF and whatever other formats the running JVM's registered ImageReaders support.

Attributes

Inherited from:
CubicalImagePlatform (hidden)
Source
CubicalImagePlatform.scala