morphogen.models.gaussian¶
Excursion sets of stationary Gaussian random fields.
- morphogen.models.gaussian.K_CUTOFF = 6.0¶
modes with
|k| * correlation_lengthabove this are dropped (the Gaussian spectrum is then below exp(-18) of its maximum).- Type:
Spectral cut-off
- morphogen.models.gaussian.MARGIN = 3.0¶
Margin (in correlation lengths) added around non-periodic domains.
- class morphogen.models.gaussian.GaussianField(domain, correlation_length, threshold, box_lower, box_lengths, mode_seed, anisotropy=None, **kwargs)[source]¶
Bases:
MicrostructurePhase 1 = {Y > threshold} for a unit-variance Gaussian field Y.
Y is a finite sum of Fourier modes on the generation box (the domain if periodic, the domain enlarged by 3 correlation lengths otherwise), so the same realization can be evaluated exactly at any resolution.
- anisotropy¶
isotropic)
- Type:
The affine anisotropy of the covariance
rho(|A^-1 h|)(None
- field(shape=None, *, voxel_size=None, grid: Grid | None = None) VoxelImage[source]¶
Values of the unit-variance Gaussian field at the voxel centres (float32).
- 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).
- values_at(points) ndarray[source]¶
The Gaussian field
Yat points of space (rows): the sum of its modes.
- level_set_at(points, reach: float = inf) ndarray[source]¶
(threshold - Y) * correlation_lengthat the points, aslevel_set().
- property lipschitz: float¶
A bound of the slope of
level_set_at()(three times the root mean square of the gradient ofY, times the correlation length).
- level_set(shape=None, *, voxel_size=None, grid: Grid | None = None) VoxelImage[source]¶
(threshold - Y) * correlation_length: negative in phase 1, roughly a distance near the interface.
- class morphogen.models.gaussian.GaussianExcursion(correlation_length: float = 1.0, volume_fraction: float | None = None, threshold: float | None = None, *, anisotropy: Anisotropy | None = None)[source]¶
Bases:
ModelExcursion set {Y > threshold} of a Gaussian field with covariance exp(-h^2 / 2 l^2).
Give the volume fraction
pof the excursion (thresholdPhi^-1(1 - p)) or the threshold itself. Periodic boxes should be at least ~10 correlation lengths wide. Ananisotropyputs the metric ofmorphogen.models.affinein the covariance,rho(|A^-1 h|): correlation lengthss_i lalong its principal axes, in periodic boxes too, whatever the axes (the modes of the box weighted by the spectrum atA^T k).- phases: ClassVar[dict[int, str]] = {0: 'phase 0', 1: 'excursion'}¶
Meaning of the phase indices of the voxel images.
- property level: float¶
- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) GaussianField[source]¶
One realization of the model in
domain.