morphogen.analysis¶
Morphological measurements on voxel images.
Public names¶
AxisCovariance— Covariance along the x, y and z axes.AxisFunction— A function of the lags along the x, y and z axes (the covariance, the lineal-path and two-point cluster functions ofmorphogen.analysis.correlation).Betti— Betti numbers and Euler characteristic of a phase.Capacity— Choquet capacityT(K)of a phase for structuring elements of growing size: the radius of balls, the length of segments, the distance of pairs of points, the edge of cubes (sizes, in length units).Components— Connected components of one phase.DirectionalPercolation— Percolation of a phase of one image along directions (directional_percolation()).Fabric— The MIL along thedirections(unit vectors), the fabric tensorM, its principal MILs (decreasing) and theiraxes(columns), the degree of anisotropy.Fire— Forest fire lit on a face of an image (burn()).Granulometry— Openings of a phase by balls of increasing radius.HoleEffect— The first minimum of the covariance below itsplateaup^2along the x, y and z axes: itslags(physical units; NaN where the covariance has none) andvalues.Minkowski— Densities of the four Minkowski functionals of a phase:V_V,S_V, the integral of mean curvatureM_V((1/2) int (1/R1 + 1/R2) dSper unit volume) and the Euler characteristicchi_V.MorphologicalCovariance— Mean of the erosion (or dilation) of a grey-level image by pairs of points along the x, y and z axes;volume_fractionholds the mean of the image.Particles— The particles of a phase:labels(0 outside the phase, else the number of the particle from 1), theirvolumesandcentroids(n x 3, in the box), theirweights(1; in an image that is not periodic, 0 for a particle cut by the frame and the factor of Miles and Lantuéjoul for the others) and thevolumeof the image.PercolationAnisotropy— Percolation thresholds of a family along directions (percolation_anisotropy()).PercolationExponent— Critical exponent of an effective property at a percolation threshold (percolation_exponent()).PercolationScaling— Finite-size scaling of a percolation threshold (percolation_scaling()).PercolationThreshold— Estimate of a percolation threshold.PoreSizes— The pore-size function of a phase: the bin edgesdelta, the exceedanceFat the edges, the densityPin the bins, and the first two moments ofδ.PowerLawTail— The tailp(x) ~ x^-exponentof a sample abovex_min: itsn_tailvalues, the standard error of the exponent and the Kolmogorov-Smirnov distance of the fit.RigidityThreshold— Finite-size scaling of the rigidity threshold of a phase, the fraction from which its elastic moduli do not vanish (rigidity_threshold()).Sections— The sections of a phase by the planes normal toaxis: their equivalent radiisqrt(area / pi), their weights (1, or the Miles–Lantuéjoul factor of a section inside the frame of a non-periodic image) and the total area of the planes.Unfolding— A 3D size distribution recovered from sections: the short semi-axes of its classes (radii, on the mean scale of the directions) and their numbers per unit volume (density, the mean of the directions); per direction (axes), the densities (directional), the largest short semi-axisa_max(scales), the measured and refolded areal densities of the 2D classes and the relative L1 error of the refolding.betti_numbers— Betti numbers ofphasein the box: components (6-connected), cavities (26-connected components of the complement that do not reach the faces) and, by the Euler-Poincaré formula, tunnels.boundary_density— Area of the boundaries between cells per unit volume, for a label image.box_counting— NumberN(s)of boxes of edgesvoxels that contain the phase, and the dimensionD = -d log N / d log s(least-squares slope over the sizes).box_dimension— Box-counting dimension of a phase (seebox_counting()).burn— The forest fire of the phasephaseof a 3-D image alongaxis(the burning algorithm of Herrmann, Hong & Stanley 1984): the phase voxels of the face at 0 normal to the axis catch fire at time 0, and at each step the fire spreads to the unburnt phase voxels among theconnectivityneighbours (6: faces; 18: and edges; 26: and corners) of those burning, the transverse directions wrapping around a periodic image (periodic, by default that of the image), never the axis. The phase percolates along the axis when the fire reaches the opposite face, at the steptime: the chemical distance between the faces, the number of steps of the shortest path through the phase (n - 1for a straight channelnvoxels long). The breadth-first burning, compiled, queues each voxel once and stops at the end of that step, unlessfullasks for the whole clusters lit on the face and their burning times; it costs the voxels burnt, whereconnected_components()labels the whole image, and decides as its flagspercolatingon open boundaries. A planar image (one voxel along z) burns in its plane, along x or y, through 4 (connectivity4 or 6) or 8 (8, 18 or 26) neighbours;burn_along()burns along any direction.burn_along— The forest fire of the phasephaseof an image alongdirection(a vector, in physical units for anisotropic voxels; in the plane of a planar image), across the core of the image along it: the cylinder (a square in 2-D) of the voxels whose centres lie withinRof the axis through the centre of the box along the direction and withinRof the centre along it,2 Rlong and across,R = D / (2 sqrt 2)for the diameterDof the ball (disc) inscribed in the box, its smallest edge. The phase voxels of the core within a step of a neighbour of crossing its lower cap catch fire at time 0 (one layer along an axis, as the face ofburn(); the cap is the plane normal to the direction at-R), the fire spreads through theconnectivityneighbours inside the core, and the phase percolates along the direction when it reaches those of the upper cap, at the steptime, the chemical distance across the core (Fireasburn();times-1 outside the core too).cell_adjacency— Pairs(a, b),a < b, of labels sharing at least one voxel face.cell_neighbors— Number of face-sharing neighbours of every label (voxel estimate).cell_volumes— Volume of every label 0..n_cells-1 (voxel counts times the voxel volume).choquet_capacity— Choquet capacityT(K) = P(K hits A)ofphase(the setA) for structuring elementsKof the givensizes(length units), estimated as the volume fraction of the dilation ofAbyK.chord_lengths— Lengths of the chords ofphasealongaxis(physical units).closing—(A (+) K') (-) K: the complement of the opening of the complement.connected_components— The connected components of a phase of an image (connectivity: 6, 18 or 26 neighbours) and whether they percolate along each axis, through the faces of a periodic image (periodic, by default that of the image); their labels withreturn_labels.connectivity_density— Number of independent tunnels per unit volume,b1 / V.consistent_shape— The shape factors(b/a, c/a)for whichshape_consistency()is the same in the three directions:r_D^4 s_hat_Dcommon to them, a linear system in the squared shape factors (b/a = (r_x / r_y)^2,c/a = (r_x / r_z)^2for the default axes). It is ill-conditioned for axes far from the planes of the grid.covariance— Covariance ofphasealong the three axes, for lags 0..max_lag voxels.covariance_map— Full 3D covariance of a periodic image, zero lag at the centre (fftshift order).covariance_minima— The first local minimum of the covariance ofphasealong each axis after it falls below its plateau, refined by the parabola through the three nearest lags.crofton_weights— Solid-angle weights (summing to 1) of the physical directionsd * spacing.dilation— Indicator ofA (+) K': the voxelsxwhereK_xhits the phase (Kas inchoquet_capacity(), the element anchored at its first point or its centre).directional_percolation— Percolation of the phasephaseof one image along each ofdirections: the fire ofburn_along()across the core of the image along each, a direction and its opposite alike.directionsare"lattice"(the axes and the diagonals of the grid: 4 directions in 2-D, 13 in 3-D, in physical units for anisotropic voxels, as for the mean intercept length offabric_tensor()),"axes", a number of directions sampled (in 2-D at equal angles over half a turn from x; in 3-D on a Fibonacci spiral over the half sphere z > 0, quasi-uniform), or vectors (rows of 2 or 3 components).erosion— Indicator ofA (-) K': the voxelsxwhereK_xlies inside the phase (outside a non-periodic box counts as outside the phase).euler_characteristic— Euler characteristic (number of components - tunnels + cavities) ofphase, 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).fabric_tensor— The MIL fabric tensor ofphase(see the module).geodesic_distance— Length of the shortest path insidephase(26-connected voxels, Euclidean steps between voxel centres) from the faceaxis = 0of the box to every voxel (inf: not reached; NaN outside the phase).geometric_tortuosity— Mean length of the shortest paths throughphasebetween the faces normal toaxis, divided by the edge of the box (inf when the phase does not percolate).granulometry— Openings ofphaseby 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).indicator— Indicator ofphase(boolean), or the partial-volume field of a float image.interface_density— Area per unit volume of the boundaries between different values ofdata.lineal_path— Lineal-path function ofphasealong the three axes, for the lags 0..max_lag voxels (half the image by default): anAxisFunction.local_thickness— Local thickness of every voxel ofphase(0 elsewhere).mean_chord_length— Mean chord length ofphaseover the three axes (all chords pooled).mean_curvature_density— Integral of mean curvature per unit volume,M_V = 2 pi chi_A(Crofton: the Euler characteristic per unit area of plane sections; exact on average for isotropic structures, the mean of three orthogonal planes otherwise).mean_intercept_length— Unit directions (13 x 3) and the mean intercept length ofphasealong each.measure— Evaluate the named measures and merge their results.minkowski— The Minkowski densities of a phase of an image: its volume fraction, specific surface, density of Euler characteristic and density of mean curvature.minkowski_curves— Densities of the four Minkowski functionals of the excursion sets{Z > u}of a grey-level image for the levelsthresholds: the volume fraction, the specific surface, the integral of mean curvature and the Euler characteristic per unit volume.morphological_covariance—E[min(Z(x), Z(x + h))](erosion by pairs of points;operation="dilation": the maximum) of a grey-level image along the three axes, lags 0..max_lag voxels (default half the box). For a binary image the erosion gives the covariance.opening—(A (-) K') (+) K: the union of the translates ofKinside the phase.particle_sizes— The particles ofphasein the volume of an image (see the module): its 26-connected parts and, withseparate, those that touch split by the watershed of their distance map from its maxima of prominence at leastprominence(physical units; default half a voxel). The particles of equivalent radius belowmin_radiusare left out. On periodic images each particle counts once, whole across the faces; otherwise those cut by the frame have a zero weight and the others the factor of Miles and Lantuéjoul.percolation_anisotropy— Percolation thresholds of a family of microstructures along directions, and their anisotropy: the fractions at which the phasephaseofgenerate(fraction, rng)(as forpercolation_threshold()) percolates along each ofdirections(as fordirectional_percolation(): across the core of the image along each).percolation_exponent— Critical exponent of the conductivity (t) or of the elastic moduli (f) of the percolating phase of a family of microstructures, by the finite-size scaling of the property at its percolation threshold, and optionally by a sweep above it.percolation_scaling— Finite-size scaling of the percolation threshold of a family of microstructures: the thresholds p½(L) ofpercolation_threshold()in boxes of each of thesizesL,generate(fraction, rng, size)returning an imagesizevoxels per edge, extrapolated to the infinite medium.percolation_threshold— Percolation threshold of a family of microstructures: the fraction at which the probability that the phasephaseofgenerate(fraction, rng)percolates crosses 1/2.phase_fractions— Volume fraction of every phase index present in an integer image.pore_size_function— The pore-size function ofphase(by default the pores, phase 0): the law of the distance from its points to the other phase (see the module).power_law_tail— The power-law tail of a sample (see the module): its exponent by maximum likelihood abovex_min, given or chosen by the Kolmogorov-Smirnov distance among the values that leave at leastmin_tailof them in the tail (at mostCANDIDATESof them, quantiles of the sample).discrete: integer values (at least 1), the lawx^-a / zeta(a, x_min).radial_distribution— The radial distribution functiong(r)of points in a periodic box of edgesbox: the centres of the bins ofr(up tor_max, a quarter of the smallest edge by default) andgin them.rigidity_threshold— Rigidity threshold of a phase of a family of microstructures: the fraction from which its elastic moduli by the FFT solver do not vanish, the other phases void, by the finite-size scaling of the fractions at which half the realizations of boxes of each of thesizesbear.saltykov_matrix—P[I - 1, J - 1]: the probability that a particle of the 3D classI(largest section radiusI delta) is cut in a section of the 2D classJ(radii between(J - 1) deltaandJ delta), classes counted upward; its rows sum to 1.section_euler_density— Euler characteristic per unit area of the plane sections ofphasenormal to the three axes (4-connected in the planes: pixels - pairs of neighbours + 2 x 2 blocks), averaged over the axes. Periodic images are counted on the tori of the sections.section_scales—(kappa, h): an ellipsoid of short semi-axisa, shape factorsshape = (b/a, c/a)and axesrotation(columns: the directions of its axes a, b, c in the frame of the image; default x, y, z) is cut by the planes normal toaxisin sections of equivalent radius at mostkappa a, and spansh aacross them. From a fabric tensorf:shape = (f.ratios[1], f.ratios[0]),rotation = f.axes[:, ::-1].section_sizes— The sections ofphaseby the planes of voxels normal toaxis(8-connected pixels).separate: touching sections are split by a watershed of their distance map from its maxima of prominence at leastprominence(physical units, default half a pixel), in the manner of the binary watershed of Fiji. Sections of equivalent radius belowmin_radiusare dropped. On periodic images each section counts once, whole across the faces; otherwise the sections cut by the frame are dropped and the others weighted byn1 n2 / ((n1 - 1 - w1)(n2 - 1 - w2))for their extentswin pixels (Miles–Lantuéjoul).shape_consistency— The mean section radius overkappain each direction (the axes ofsections, a list ofSectionsor a mapping axis -> mean radius):(pi / 4) m2 / m1of the short semi-axes in every direction when the particles have the given shape.specific_surface— Interface area ofphaseper unit volume of the image (Crofton estimate).structure_factor— The structure factorS(k)of points in a periodic box, averaged over the wave vectors2π n / L(ninteger, not all zero) in bins of|k|up tok_max(twenty times the smallest wave number by default): the centres of the bins with wave vectors andSin them.two_point_cluster— Two-point cluster function ofphasealong the three axes (face-connected clusters), for the lags 0..max_lag voxels: anAxisFunction.unfold_sections— The size distribution of particles of a common shape (shape,rotation: seesection_scales()) from their sections normal to one or several axes (aSectionsor a list), as Degdeg & Dirrenberger: in each direction the sections up to thepercentileof their radii,r_max, fall inbinsclasses of widthr_max / bins, and theclasseslargest 3D classes (short semi-axesI / binsofa_max = r_max / kappa) come from Saltykov’s recursion; their densities are averaged over the directions class by class.classes=None: the number that minimizes the summed L1 error of refolding the mean through each direction (several directions: with one, the refolding of all the classes is exact).volume_fraction— Volume fraction ofphase(mean of the partial volumes for float images).wrapping— Whether a component of a phase of an image wraps around the periodic box along each axis (connectivity: 6, 18 or 26 neighbours): a cycle of neighbours through the faces winds around the axis, so that the tiled component is a cluster unbounded along it, the percolation of a periodic medium. Joining the two faces normal to the axis inside the box (the flagspercolatingofconnected_components()) neither implies it (a staircase from face to face closes into no cycle) nor follows from it (a helix through the faces normal to y wraps along x and y and joins no pair of faces).
Modules¶
- morphogen.analysis.anisotropy
- morphogen.analysis.basic
- morphogen.analysis.cells
- morphogen.analysis.connectivity
- morphogen.analysis.correlation
- morphogen.analysis.covariance
- morphogen.analysis.fractal
- morphogen.analysis.measures
- morphogen.analysis.morphology
- morphogen.analysis.particles
- morphogen.analysis.percolation
- morphogen.analysis.power_laws
- morphogen.analysis.random_sets
- morphogen.analysis.stereology
- morphogen.analysis.surface
- morphogen.analysis.topology