Geometric Data Type and Structures
scikit-shape includes both explicit and implicit representations for geometries. The explicit geometric representations are curves and triangulated domains in 2d. The implicit geometric representations are based on labeled grids, which can be usedto encode regions both in 2d and 3d. A specific case of labeled grids is the phase field function which decomposes the domain into two regions, one labeled with -1, and another labeled with +1. The following is a list of the data structures available to encode geometries:
skshape.geometry.curve.Curveis used to store the discretization
representation of a simple closed curve in 2d. What is a stored is an ordered collection (x,y) points of the nodes of the curves. Additionally, this class includes many functions for geometric computations. For example, the unit normals or curvature of the curve on the nodes or intermediate points can be computed.
skshape.geometry.curve.CurveFamilystore hierarchical collections
of skshape.geometry.curve.Curve objects. The curves in this collection
do not intersect one another. Hence, the collection is a tree-like hierarchy,
in which a curve may be enclosed by a curve or may enclose other curves.
The skshape.geometry.curve.CurveFamily also includes the same geometric
computation routines as the skshape.geometry.curve.Curve class.
skshape.geometry.domain.Domain2dis for explicit representations of
2d domains as triangulations. It can be created by passing it the region
boundaries in the form of skshape.geometry.curve.Curve or
skshape.geometry.curve.CurveFamily objects. It creates and stores
the corresponding triangulations internally.
skshape.geometry.grid.Grid2dandskshape.geometry.grid.Grid3d
are abstractions to represent regions embedded in image-like regular grids.
numpy.arrayis not part of scikit-shape, and is convenient to store
labels indicating regions of an image domain. It is used as input or output for some of the scikit-shape functions. For an example, for an image with four regions, each pixel location can be labeled with an integer 0,1,2,3, and this labeling (i.e. segmentation) can be stored in an integer values NumPy array.
