background.Rmd
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).
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.
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 combination of all of the above is exactly the idea behind the {morphology} package, where we leverage:
to implement a flexible API that allows us to
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.