morphogen.models.boolean¶
Boolean models: unions of random grains implanted on Poisson points.
- class morphogen.models.boolean.BooleanSpheres(radius: Distribution = Constant(value=1.0), volume_fraction: float | None = None, intensity: float | None = None, *, anisotropy: Anisotropy | None = None)[source]¶
Bases:
ModelBoolean model of spheres: union of balls centred on a Poisson point process.
Give either the volume fraction of the union or the intensity of the germs; the other follows from
p = 1 - exp(-theta * E[4/3 pi R^3]).- phases: ClassVar[dict[int, str]] = {0: 'matrix', 1: 'spheres'}¶
Meaning of the phase indices of the voxel images.
- count_label: ClassVar[str] = 'spheres'¶
Objects counted by
expected_count()(fibres, spheres, cells…).
- property mean_grain_volume: float¶
- property theta: float¶
Intensity of the Poisson germs.
- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) PrimitiveUnion[source]¶
One realization of the model in
domain.
- 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).
- class morphogen.models.boolean.BooleanCylinders(radius: Distribution = Constant(value=1.0), length: Distribution = Constant(value=10.0), orientation: OrientationDistribution = Isotropic(), caps: str = 'flat', volume_fraction: float | None = None, intensity: float | None = None)[source]¶
Bases:
ModelBoolean model of finite fibres: cylinders (flat caps) or spherocylinders.
Fibre centres form a Poisson point process; radius, length (of the cylindrical part) and axis orientation are independent random variables. The covariance (
covariance()) is in closed form along any direction, for any law of the axes (Peyrega et al. 2009).- phases: ClassVar[dict[int, str]] = {0: 'matrix', 1: 'fibres'}¶
Meaning of the phase indices of the voxel images.
- count_label: ClassVar[str] = 'fibres'¶
Objects counted by
expected_count()(fibres, spheres, cells…).
- property mean_grain_volume: float¶
- property mean_grain_surface: float¶
- property theta: float¶
- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) PrimitiveUnion[source]¶
One realization of the model in
domain.
- 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).
- mean_covariogram(h, direction=None) ndarray[source]¶
E[K(h)] = E|K ∩ (K + h)|, the mean geometric covariogram of the fibres over their radii, lengths and axes, forhof the lengthshalongdirection(averaged over the directions without one):K = (l - |h·u|)+ lens(|h × u|)for cylinders (Peyrega et al. 2009, eq. 15), the integral along the axis of the lens of the sections for spherocylinders (morphogen.theory.spherocylinder_covariogram());E[K(0)] = E[V]andint E[K(h)] dh = E[V^2].
- covariance(h, direction=None) ndarray[source]¶
C(h) = P(x in A, x + h in A) = 1 - 2q + q^2 exp(theta E[K(h)])alongdirection(any for isotropic axes), or averaged over the directions ofhwithout one (morphogen.theory.oriented_covariance()).
- integral_range() float[source]¶
A3 = int (C(h) - p^2) dh / (p q)over the space:4 pi int h^2 (C̄(h) - p^2) dh / (p q),C̄the covariance averaged over the directions (96 Gauss-Legendre distances up to the largest extent of a fibre); the mean volume of the fibres weighted by their volumes,E[V^2] / E[V], asp -> 0.