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.
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.
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.