morphogen.models.tessellation¶
Voronoi and Laguerre (power) tessellations of Poisson germs.
A grain-boundary phase of thickness t can be added between the cells: the points
closer than t / 2 to a face shared by their cell and another. The faces of the cell
of germ g_i containing x lie in the planes where the power distances
p_j(x) = |x - g_j|^2 - w_j of two germs are equal; x is at distance
(p_j(x) - p_i(x)) / (2 |g_j - g_i|) from the plane of germ j, and the smallest of
these distances is its distance to the boundary of its (convex) cell. The germs whose
plane is closer than r are among those of lifted distance below l_i + 2 r
(l_i: lifted distance to the own germ), so that the nearest germs suffice.
- class morphogen.models.tessellation.Tessellation(domain: Domain, germs, weights=None, cell_phases=None, orientations=None, boundary_thickness: float = 0.0, boundary_phase: int = 0, **kwargs)[source]¶
Bases:
MicrostructureCells of germs
g_iwith weightsw_i: x belongs to the cell minimizing the power distance|x - g_i|^2 - w_i(Voronoi when all weights vanish).Each cell carries a phase index and optionally crystal orientations (Bunge Euler angles in degrees). The cell label of a voxel is the index of its germ. With a
boundary_thickness, the points closer than half of it to a face shared by two cells are of phaseboundary_phase(they keep the label of their cell).- property n_cells: int¶
- boundary_distance(points, reach: float = inf) ndarray[source]¶
Distance from each point to the nearest face shared by its cell and another (
inffor a single cell); exact up toreach, at leastreachbeyond.
- labels(shape=None, *, voxel_size=None, grid: Grid | None = None) VoxelImage[source]¶
Image of cell labels (int32 germ indices).
- voxelize(shape=None, *, voxel_size=None, grid: Grid | None = None, supersampling=1)[source]¶
Phase image (uint8), or partial volume fractions of phase 1 (float32) when
supersampling > 1(supersampling**3sub-samples per voxel).
- level_set(shape=None, *, voxel_size=None, grid: Grid | None = None) VoxelImage[source]¶
Grains of phase 1 in a grain-boundary phase 0: half the thickness of the boundaries minus the distance to them (negative in the grains); the cells of phase 1 among cells of other phases:
phase_level_set().
- implicit_phases() list[int][source]¶
The phases of the realization, each described by an implicit function (
phase_level_set()), in increasing order: phase 1 and what surrounds it (the structures of more phases, or of others, say theirs).
- phase_level_set(phase: int, shape=None, *, voxel_size=None, grid: Grid | None = None) VoxelImage[source]¶
The implicit function of a phase (see
Microstructure.phase_level_set()): for the cells of a phase, the smallest power distance to their germs minus the smallest to the germs of the cells of the other phases, over twice the mean spacing of the germs: zero on the faces between cells of the phase and cells of another (the planes where the two power distances are equal), near which it is the distance to the face times the ratio of the distance between their germs to the mean spacing. A grain-boundary phase is the layer within half its thickness of the faces of the cells, which the cells lose.
- level_set_at(points, reach: float = inf) ndarray[source]¶
Grains of phase 1 in a grain-boundary phase 0: half the thickness of the boundaries minus the distance to them at the points; the other tessellations of several phases: the function of phase 1 (
phase_level_sets_at()).
- phase_level_sets_at(points, reach: float = inf) dict[int, ndarray][source]¶
The functions of
phase_level_set()at the points: for the cells of a phase, the smallest power distance to their germs minus the smallest to the germs of the other phases, over twice the mean spacing of the germs (zero on the faces between cells of the phase and cells of another); a grain-boundary phase, the layer within half its thickness of the faces of the cells. A tessellation of one phase without a boundary phase has no interface (and none: its exact geometry is that of its cells).
- cell_complex(whole: bool = False)[source]¶
Exact cells restricted to the domain: convex pieces with shared facets (
morphogen.mesh.polyhedra.CellComplex), computed once. Withwhole(periodic tessellations), the whole cells, uncut by the faces of the box.
- class morphogen.models.tessellation.Voronoi(n_cells: int | None = None, intensity: float | None = None, phase_fractions: tuple[float, ...] | None = None, crystal_orientations: bool = False, boundary_thickness: float = 0.0, boundary_phase: int | None = None, germs: str = 'poisson', stealthiness: float = 0.3, *, texture: OrientationDistribution | None = None, anisotropy: Anisotropy | None = None)[source]¶
Bases:
_TessellationModelVoronoi tessellation (mosaic): each point belongs to its nearest germ. The germs are Poisson points, or a stealthy hyperuniform pattern (
germs: stealthy: the collective coordinates of Torquato and coworkers,morphogen.kernels.collective), a fixed number of them in the box, whose cells are disordered but far more regular.- theory(domain: Domain | None = None) dict[str, float][source]¶
Theoretical morphological characteristics known in closed form (may be empty).
Some values depend on the domain (e.g. the intensity implied by a number of cells).
- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) Tessellation¶
One realization of the model in
domain.
- class morphogen.models.tessellation.Laguerre(n_cells: int | None = None, intensity: float | None = None, phase_fractions: tuple[float, ...] | None = None, crystal_orientations: bool = False, boundary_thickness: float = 0.0, boundary_phase: int | None = None, radius: Distribution = Constant(value=1.0), germs: str = 'poisson', packing_fraction: float = 0.3, *, texture: OrientationDistribution | None = None, anisotropy: Anisotropy | None = None)[source]¶
Bases:
_TessellationModelLaguerre (power) tessellation of germ spheres, the weights being their
r^2.The germs are Poisson points with independent radii, or the centres of a packing of non-overlapping spheres (random sequential addition, the largest first) whose radii follow the distribution up to a common factor filling
packing_fractionof the box: the cells then follow the sizes of the spheres closely (e.g. Fan et al. 2004).- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) Tessellation¶
One realization of the model in
domain.