Morphological quantities

Morphological quantities have been studied for a long time already in the framework of materials research. While this can be traced back to the determination of effective electrical properties of a dilute suspension of spherical particles in the first half of the 20th century, only in the 1950s and 1960s, higher-order statistical functions, or so-called n-point probability functions were introduced, for describing higher concentrations of particles (see Torquato and Stell 1982 and references therein). By the time we started evaluating morphological quantities of digital representations of material microstructures (i.e. categorical arrays), several “classic” quantities like the two-point probability function, the lineal path function, and the chord length and pore size distributions, which are all used until today, were already in place (Coker and Torquato 1995). Since then, most research has been related to advective and diffusive transport in two-phase (i.e. pore vs solid) media, focussing on the relation between their effective transport properties and morphological quantities (*e.g.* Hlushkou et al. 2015; Röding, Ma, and Torquato 2020; Bagherian et al. 2021), and the stochastic reconstruction of random media honouring such morphological quantities and the corresponding effective properties (*e.g.* Yeong and Torquato 1998; Jiao, Stillinger, and Torquato 2009; Lalit M. Pant, Mitra, and Secanell 2015; Lemmens et al. 2019). More recently, in the late 1990s and early 21st century, with the advent of reactive transport modelling, and need for increasingly complex phenomenological assessments (e.g. in the framework of radioactive waste disposal), there is an increasing need for morphological description, as well as stochastic reconstruction, of multi-phase (i.e. more than two) media, where typically different solid phases are distinguished, additional to the void or pore phase. The efforts into characterisation of multi-phase systems have been limited however (*e.g.* Lalit M. Pant, Mitra, and Secanell 2014; Chen 2014; Lemmens et al. 2019), while recent approaches involving multiple-point statistics, exemplar-based texture synthesis, and deep learning largely skip the characterization step, and directly aim at reconstructing (Bostanabad et al. 2018).

Spatial point patterns

While nearest-neighbour statistics have been in use for the description of particle systems in materials research (*e.g.* Torquato 1995a, 1995b; Middlemas and Torquato 2020), similar measures of morphology have been in use for the analysis of spatial point patterns (e.g. the reduced second moment or K function, the pair correlation function, the empty space function), with a wide range of application domains (from ecology (*e.g.* Szmyt 2014) to histology (*e.g.* Bull et al. 2023)), where they were extended to cross-type measures for multi-type point patterns (one type vs another, or one type vs all others), and to 3D point patterns (A. J. Baddeley et al. 1993). Instead of applying such cross-type nearest-neighbour statistics to particle systems or point patterns, they can be applied to digital representations of microstructures (i.e. categorical arrays) instead. In fact, any categorical array can be seen as a multi-type point pattern, and application of spatial point pattern analysis (*e.g.* through the tooling provided by A. Baddeley, Turner, and Rubak 2024) is straightforward when using the array indices as spatial coordinates. One important aspect that is missing here is the notion of connectivity within a given phase, which does come up with important morphological quantities like the lineal path and cluster function.

Expectation vs distribution

Most of the classic ways to describe morphology can be based somehow on the expectation of the amount of neighbouring voxels within a certain distance. Just considering the expectation, or rather a single summary statistic, in fact means that we are only extracting a small amount of information from the full k nearest neighbour distributions for all evaluated points. We could in fact also consider measures of spread, or even specific quantiles, to quantify how consistent the considered descriptor is locally within the assessed array. The specific morphological quantity labelled “coarseness” has been used for such purposes (see e.g. Coker and Torquato 1995), quantifying variability in the local volume fraction, in function of a given window size, but there is no reason why we cannot extend this to all other descriptors where we need to search for more than a single neighbour. Within the spatial point patterns domain, this is termed second-order neighbourhood analysis (Getis and Franklin 2010), and gives rise to localized versions of the commonly used descriptors (see e.g. A. Baddeley, Turner, and Rubak 2024), again in function of a given window size.

The {morphology} R package

The combination of all of the above is exactly the idea behind the {morphology} package, where we leverage:

  1. The approximate nearest-neighbour search provided by {nabor} (Mangenat and Jefferis 2018), which wraps libnabo, a very performant nearest-neighbour search library using a k-d tree data structure (Elseberg et al. 2012),
  2. The connected components algorithm provided by {mmand} (Clayden 2023), with a variable connectivity kernel, and
  3. The shortest path algorithms provided by {igraph},

to implement a flexible API that allows us to

  1. perform different kinds of (k) nearest neighbour queries,
  2. compute all the “classic” morphological quantities, but also very recent ones involving shortest paths (Bagherian et al. 2021), from such queries by applying different kinds of normalisation and using “minus sampling” (aka “guard area”) edge correction (both used in the spatial point patterns (A. J. Baddeley et al. 1993) and morphological quantities (Coker and Torquato 1995) domains),
  3. compute their cross-category extensions (when applicable, so not for connectivity and shortest path-related quantities),
  4. compute 1D, 2D and 3D versions,
  5. enable filtering on 1D, 2D or 3D connectivity,
  6. allow the use of arbitrary summary functions, typically of the numbers of neighbours in function of distance.

The PoreSpy (Gostick et al. 2019) Python package provides similar functionality, but is constrained a bit closer to the classic morphological quantities. It also has a broader scope, which includes pore network extraction, exporting to common formats for process modelling, etc.

The MCRpy (Seibert et al. 2022) Python package provides differentiable versions of the classic morphological quantities, and additionally Gram matrices for characterizing morphology. The gradient information provided by these can be leveraged in the reconstruction optimization problem.

While all of this is readily accessible from R through {reticulate} (Ushey, Allaire, and Tang 2024), with {morphology}, we are aiming at more flexible, detailed, and extensive evaluation of morphological quantities.

References

Baddeley, A. J., R. A. Moyeed, C. V. Howard, and A. Boyde. 1993. “Analysis of a Three-Dimensional Point Pattern with Replication.” Applied Statistics 42 (4): 641. https://doi.org/10.2307/2986181.
Baddeley, Adrian, Rolf Turner, and Ege Rubak. 2024. Spatstat.explore: Exploratory Data Analysis for the Spatstat Family. http://spatstat.org/.
Bagherian, Amirhossein, Seyedfarzad Famouri, Mostafa Baghani, Daniel George, Azadeh Sheidaei, and Majid Baniassadi. 2021. “A New Statistical Descriptor for the Physical Characterization and 3D Reconstruction of Heterogeneous Materials.” Transport in Porous Media, August. https://doi.org/10.1007/s11242-021-01660-9.
Bostanabad, Ramin, Yichi Zhang, Xiaolin Li, Tucker Kearney, L. Catherine Brinson, Daniel W. Apley, Wing Kam Liu, and Wei Chen. 2018. “Computational Microstructure Characterization and Reconstruction: Review of the State-of-the-Art Techniques.” Progress in Materials Science 95 (June): 1–41. https://doi.org/10.1016/j.pmatsci.2018.01.005.
Bull, Joshua A, Eoghan J Mulholland, Simon J Leedham, and Helen M Byrne. 2023. “Extended Correlation Functions for Spatial Analysis of Multiplex Imaging Data.”
Chen, Dongdong. 2014. “Reconstruction of Multiphase Microstructure Based on Statistical Descriptors.” Physica A.
Clayden, Jon. 2023. Mmand: Mathematical Morphology in Any Number of Dimensions. https://github.com/jonclayden/mmand.
Coker, David A., and Salvatore Torquato. 1995. “Extraction of Morphological Quantities from a Digitized Medium.” Journal of Applied Physics 77 (12): 6087–99. https://doi.org/10.1063/1.359134.
Elseberg, Jan, Stephane Magnenat, Roland Siegwart, and Andreas Nuchter. 2012. “Comparison of Nearest-Neighbor-Search Strategies and Implementations for Efficient Shape Registration.”
Getis, Arthur, and Janet Franklin. 2010. “Second-Order Neighborhood Analysis of Mapped Point Patterns.” In, 68:93–100. https://doi.org/10.1007/978-3-642-01976-0_7.
Gostick, Jeff T., Zohaib A. Khan, Thomas G. Tranter, Matthew D. r Kok, Mehrez Agnaou, Mohammadamin Sadeghi, and Rhodri Jervis. 2019. “PoreSpy: A Python Toolkit for Quantitative Analysis of Porous Media Images.” Journal of Open Source Software 4 (37): 1296. https://doi.org/10.21105/joss.01296.
Hlushkou, D., H. Liasneuski, U. Tallarek, and S. Torquato. 2015. “Effective Diffusion Coefficients in Random Packings of Polydisperse Hard Spheres from Two-Point and Three-Point Correlation Functions.” Journal of Applied Physics 118 (12): 124901. https://doi.org/10.1063/1.4931153.
Jiao, Y., F. H. Stillinger, and S. Torquato. 2009. “A Superior Descriptor of Random Textures and Its Predictive Capacity.” Proceedings of the National Academy of Sciences 106 (42): 17634–39. https://doi.org/10.1073/pnas.0905919106.
Lemmens, Laurent, Bart Rogiers, Diederik Jacques, Marijke Huysmans, Rudy Swennen, Janos L. Urai, Guillaume Desbois, and Eric Laloy. 2019. “Nested Multiresolution Hierarchical Simulated Annealing Algorithm for Porous Media Reconstruction.” Physical Review E 100 (5): 053316. https://doi.org/10.1103/PhysRevE.100.053316.
Mangenat, Stephane, and Gregory Jefferis. 2018. Nabor: Wraps Libnabo, a Fast k Nearest Neighbour Library for Low Dimensions. https://github.com/jefferis/nabor https://github.com/ethz-asl/libnabo.
Middlemas, Timothy M, and Salvatore Torquato. 2020. “Nearest-Neighbor Functions for Disordered Stealthy Hyperuniform Many-Particle Systems.” Journal of Statistical Mechanics: Theory and Experiment 2020 (10): 103302. https://doi.org/10.1088/1742-5468/abb8cb.
Pant, Lalit M., Sushanta K. Mitra, and Marc Secanell. 2015. “Multigrid Hierarchical Simulated Annealing Method for Reconstructing Heterogeneous Media.” Physical Review E 92 (6): 063303. https://doi.org/10.1103/PhysRevE.92.063303.
Pant, Lalit M, Sushanta K Mitra, and Marc Secanell. 2014. “Stochastic Reconstruction Using Multiple Correlation Functions with Different-Phase-Neighbor-Based Pixel Selection.” PHYSICAL REVIEW E.
Röding, Magnus, Zheng Ma, and Salvatore Torquato. 2020. “Predicting Permeability via Statistical Learning on Higher-Order Microstructural Information.” Scientific Reports 10 (1): 15239. https://doi.org/10.1038/s41598-020-72085-5.
Seibert, Paul, Alexander Raßloff, Karl Kalina, Marreddy Ambati, and Markus Kästner. 2022. “Microstructure Characterization and Reconstruction in Python: MCRpy.” Integrating Materials and Manufacturing Innovation 11 (3): 450–66. https://doi.org/10.1007/s40192-022-00273-4.
Szmyt, Janusz. 2014. “Spatial Statistics in Ecological Analysis: From Indices to Functions.” Silva Fennica 48 (January). https://doi.org/10.14214/sf.1008.
Torquato, S. 1995a. “Mean Nearest-Neighbor Distance in Random Packings of Hard D -Dimensional Spheres.” Physical Review Letters 74 (12): 2156–59. https://doi.org/10.1103/PhysRevLett.74.2156.
———. 1995b. “Nearest-Neighbor Statistics for Packings of Hard Spheres and Disks.” Physical Review E 51 (4): 3170–82. https://doi.org/10.1103/PhysRevE.51.3170.
Torquato, S., and G. Stell. 1982. “Microstructure of Two-Phase Random Media. I. The n -Point Probability Functions.” The Journal of Chemical Physics 77 (4): 2071–77. https://doi.org/10.1063/1.444011.
Ushey, Kevin, JJ Allaire, and Yuan Tang. 2024. Reticulate: Interface to Python. https://rstudio.github.io/reticulate/.
Yeong, C. L. Y., and S. Torquato. 1998. “Reconstructing Random Media.” Physical Review E 57 (1): 495–506. https://doi.org/10.1103/PhysRevE.57.495.