morphogen.analysis.morphology

Chords, granulometry, local thickness, Euler characteristic and geometric tortuosity.

  • Chord lengths: lengths of the runs of a phase along the lines of the grid (the linear sections of the phase). On periodic images, runs wrap around the faces; on other images, runs cut by the faces are left out.

  • Granulometry by openings: fraction of the phase left by the opening with a ball of radius r (erosion then dilation, both exact Euclidean balls through distance transforms; Matheron 1975, Serra 1982). Its decrease with r is the size distribution of the phase; the local thickness of a voxel is twice the largest radius of an opening that keeps it (Hildebrand & Rüegsegger 1997): the pore sizes are the local thickness of the pores.

  • Euler characteristic of a phase (6-connected voxels): number of components - tunnels + cavities, from the counts of voxels, pairs, squares and cubes of voxels (Ohser & Mücklich 2000); its density, with the volume fraction and the specific surface, gives three of the Minkowski functionals.

  • Geometric tortuosity: shortest paths inside the phase (26-connected voxels, Euclidean steps) from one face of the box to the opposite face, divided by the distance between the faces.

morphogen.analysis.morphology.chord_lengths(image, phase: int = 1, axis: int = 0, *, periodic=None) → ndarray[source]

Lengths of the chords of phase along axis (physical units).

morphogen.analysis.morphology.mean_chord_length(image, phase: int = 1, *, periodic=None) → float[source]

Mean chord length of phase over the three axes (all chords pooled).

class morphogen.analysis.morphology.Granulometry(radii: ndarray, fractions: ndarray, thickness: ndarray)[source]

Bases: object

Openings of a phase by balls of increasing radius.

property size_distribution: ndarray

Volume fraction of the phase whose largest opening radius is each radius.

property mean_radius: float

Mean of the radius of the largest ball (of the radii probed) containing a point of the phase.

morphogen.analysis.morphology.granulometry(image, phase: int = 1, radii=None, *, periodic=None) → Granulometry[source]

Openings of phase by balls of the radii given (physical units; default: steps of half a voxel up to the largest inscribed ball). The opening of radius r is the union of the balls of radius r (the voxels closer than r to their centre) whose centre is at least r from the voxels outside the phase, as in the local thickness of Hildebrand & Rüegsegger (1997): a layer of n voxels has thickness n voxels. Each voxel gets the largest radius whose opening keeps it, so that the fractions kept decrease with the radius (discrete Euclidean balls do not make exact granulometries).

morphogen.analysis.morphology.local_thickness(image, phase: int = 1, *, periodic=None) → ndarray[source]

Local thickness of every voxel of phase (0 elsewhere).

morphogen.analysis.morphology.euler_characteristic(image, phase: int = 1, *, periodic=None) → int[source]

Euler characteristic (number of components - tunnels + cavities) of phase, 6-connected (its complement 26-connected): vertices - edges + squares - cubes of the complex whose vertices are the voxels of the phase, edges their pairs of face neighbours, squares and cubes their 2 x 2 and 2 x 2 x 2 blocks (Ohser & Mücklich 2000). Periodic images are counted on the torus. Objects closer than a voxel touch on the image: the estimate is biased by their contacts (for random objects, about half the number of pairs closer than a voxel).

class morphogen.analysis.morphology.Minkowski(volume_fraction: float, specific_surface: float, euler_density: float, mean_curvature: float = nan)[source]

Bases: object

Densities of the four Minkowski functionals of a phase: V_V, S_V, the integral of mean curvature M_V ((1/2) int (1/R1 + 1/R2) dS per unit volume) and the Euler characteristic chi_V.

morphogen.analysis.morphology.minkowski(image, phase: int = 1, *, periodic=None) → Minkowski[source]

The Minkowski densities of a phase of an image: its volume fraction, specific surface, density of Euler characteristic and density of mean curvature.

morphogen.analysis.morphology.geodesic_distance(image, phase: int = 1, axis: int = 0) → ndarray[source]

Length of the shortest path inside phase (26-connected voxels, Euclidean steps between voxel centres) from the face axis = 0 of the box to every voxel (inf: not reached; NaN outside the phase).

morphogen.analysis.morphology.geometric_tortuosity(image, phase: int = 1, axis: int = 0) → float[source]

Mean length of the shortest paths through phase between the faces normal to axis, divided by the edge of the box (inf when the phase does not percolate).