Image Anal Stereol 2013;32:27-43 Original Research Paper ESTIMATION OF TORTUOSITY AND RECONSTRUCTION OF GEODESIC PATHS IN 3D Charles Peyregab and Dominique Jeulin Centre de Morphologie Mathématique, Mathématiques et Systèmes, Mines ParisTech, 35 rue Saint Honoré, 77300 Fontainebleau, France e-mail: charles.peyrega@mines-paristech.fr, dominique.jeulin@ensmp.fr (Received June 6, 2012; revised January 6, 2013; accepted January 22, 2013) ABSTRACT The morphological tortuosity of a geodesic path in a medium can be defined as the ratio between its geodesic length and the Euclidean distance between its two extremities. Thus, the minimum tortuosity of all the geodesic paths into a medium in 2D or in 3D can be estimated by image processing methods using mathematical morphology. Considering a medium, the morphological tortuosities of its internal paths are estimated according to one direction, which is perpendicular to both starting and ending opposite extremities of the geodesic paths. The used algorithm estimates the morphological tortuosities from geodesic distance maps, which are obtained from geodesic propagations. The shape of the propagated structuring element used to estimate the geodesic distance maps on a discrete grid has a direct influence on the morphological tortuosity and has to be chosen very carefully. The results of our algorithm is an image with pixels p having a value equal to the length of the shortest path containing p and connected to two considered opposite boundaries A and B of the image. The analysis of the histogram of the morphological tortuosities gives access to their statistical distribution. Moreover, for each tortuosity the paths can be extracted from the original image, which highlights the location of them into the sample. However, these geodesic paths have to be reconstructed for further processing. The extraction, because applying a threshold on the tortuosities, results in disconnected components, especially for highly tortuous paths. This reconstruction consists in reconnecting these components to the geodesic path linking the two opposite faces, by means of a backtracking algorithm. Keywords: 3D images, fibrous media, geodesic paths, mathematical morphology, tortuosity. INTRODUCTION The morphological tortuosity is one of the measurements which have been processed on 3D images to characterize a fibrous material called Thermisorel™, and which is made of wooden fibres. This medium was used as a reference material in the Silent Wall project for its good properties in thermal and acoustical insulating (Peyrega et al., 2009; 2010; Peyrega, 2010). The main objective of the Silent Wall ANR1 project consisted in optimizing the acoustic properties of fibrous media by modifying their microstructures. Since the morphological tortuosity of the microscopic pores has a direct influence on the acoustic absorption on such a material at the macroscopic scale, this morphological parameter was studied for this project. This paper focuses on methods and algorithms to estimate the morphological tortuosity of a medium and to reconstruct on discrete grids in 2D and 3D geodesic paths it contains. After presenting an algorithm (Decker et al., 1998; Peyrega, 2010) to estimate the morphological tortuosity of any phase into 2D and 3D images from geodesic dilations 1 http://us2b.pierroton.inra.fr/Projets/Silent_Wall/description.htm (Lantuejoul and Beucher, 1981; Serra, 1988; Soille, 2003), we will focus on the influence of the shape of the propagating structuring elements on this estimation. Then, the studied phases can be separately characterized by histograms of tortuosities in the corresponding directions of propagation. Moreover, since geodesic propagations are handled by the algorithm, it is possible to extract the shortest paths in any direction, i.e., the geodesic paths, linking any point to two separate components which are in the same phase. Finally, these methods were applied to 3D X-Ray CT images of fibrous materials used for acoustic absorption. ESTIMATION OF THE MORPHOLOGICAL TORTUOSITY DEFINITIONS Geodesic distance In order to define the morphological tortuosity, we must start with the definition of the geodesic distance (Lantuejoul and Beucher, 1981; Serra, 1988; Soille, 2003). Considering two points x and y belonging to a set X, the shortest paths connecting them, while constrained to remain in X, are called the geodesic paths in the geodesic mask X. Thus, using the definition (Eq. 1) proposed by (Soille, 2003), with X a connected component of an image, the geodesic distance Geo_DistX (xy) between two points x and y in X is the minimum length L of all the paths P = (p1,p2,p3,...,pn) linking x and y included in X. We note pi the ith pixel of the path P between x and y composed of n connected pixels belonging to X. Geo_DistX (xy) = min {L (P) |p1 = x,pn = y,P Q X} . (1) The geodesic distance between two points x and y belonging to a medium X is illustrated by Fig. 1. According to this definition, the distance between x and w is infinite because both points belong to two different connected components of the set X. One of the challenges of this work consists in estimating a geodesic distance map on a discrete grid. Previous publications proposed methods to estimate it in different contexts (Borgefors, 1986; Soille, 1992; 1994; 2003; Coeurjolly et al., 2004). From a morphological point of view, this can be processed with geodesic dilations from x to y into X. In Fig. 2, the propagating fronts are circular, which is intuitive to estimate a Euclidean distance map in a continuum framework. However, in this paper, working on digitized images on a grid of points, we show to what extent the shape of the structuring element influences the estimation of the geodesic distance map. Morphological tortuosity We consider two separate subsets A and B of a medium X, that will be used as propagation sources. The geodesic distance of a point x G X to a subset A is defined by Lantuejoul and Beucher (1981), and by Soille (2003) in Eq. 2. Geo_DistX (x, A) = min {Geo_DistX (xy),x G X,y G A} (2) The geodesic paths connecting x to A are the paths corresponding to Geo_DistX (x, A) (Soille, 2003). In the remaining part of the paper, we consider two parallel planar sources A and B in 3D, and their separation noted Euclidean JDist (AB). For every point x G X, the morphological tortuosity corresponding to the sources A and B is defined as the ratio Eq. 3. Fig. 1. Geodesic distance in the set X between x and y. Fig. 2. Geodesic distance in the set X between x and y estimated by geodesic dilations. TortuosityXAB (x) = Geo_DistX (x, A) + Geo_DistX (x, B) Euclidean_Dist (AB) (3) In what follows, the morphological tortuosity of every point of a set X (namely fibres or pores) will be estimated by means of geodesic dilations (Lantuejoul and Beucher, 1981; Serra, 1988; Soille, 2003) implemented on a grid of points, since we are using 3D digitized images of a real material. Acoustic tortuosity in physics In acoustics, the tortuosity a (to) has a physical interpretation linked to both the frequency to of the acoustic wave, and to the geometry of the microstructure, through which the wave front is propagating. Moreover, we note a^ the acoustic tortuosity for sound waves having an infinite frequency. According to Allard (1993) and Allard et al. (1994), we can write the relationship between the tortuosity a (to) and the acoustic velocity u of the propagating wave through the microstructure into Eq. 4. ax = lim a (to ) = lim to 2 (4) Thus, the physical interpretation of a (a) is directly linked to both the average acoustic velocity of the wave and to the morphological tortuosity of the microstructure. For straight paths, both morphological and acoustic tortuosities are equal to 1 because in this case, we can write: (u2) = (u)2. THE ALGORITHM The algorithm makes use of the geodesic dilation (Lantuejoul and Beucher, 1981; Serra, 1988; Soille, 2003), defined as follows. Consider an elementary structuring element defined on the grid of points from a point and its nearest neighbours. It defines a connectivity on the graph generated by the grid, for instance the C4 and the C8 connectivities starting from a square grid and the 4 or the 8 nearest neighbours, the C6 and the C26 connectivities on a cubic grid by means of the 6 or the 26 nearest neighbours. Noting 8 (A) the dilation of a set A by the elementary structuring element, and 8X(-1)(A) the geodesic dilation of size 1 defined from the set X , we have: 8XX1)(A) = 8(A) nX . 5) Extraction of the percolating paths: IF ImInfFwdBwd > 0: ImTortuosity = ImAddFwdBwd, ELSE: ImTortuosity = 0 6) Normalization of ImTortuosity by the Euclidean distance between A and B to get the tortuosity This algorithm is illustrated in 2D by the Fig. 3 but its principle is the same in 3D. Let X be the set composed of every connected components (white, green and pink) different from the background in black. Let the top A and bottom B faces be the so-called marker-faces used as markers to be dilated into the set. n J\ I Direction of Forward I propagation The geodesic dilation of A of size n in X is obtained after n iterations of 8X(-1)(A). From its definition, the result of the geodesic dilation depends on the choice of the elementary structuring element and of its corresponding connectivity. In the rest of the paper, we will compare geodesic paths and geodesic distances obtained on images with different elementary structuring elements. In order to estimate the morphological tortuosities of every path linking a voxel v of a set X to two opposite faces A and B of X (Eq. 3), the algorithm proposed in 3D by Decker et al. (1998) has been used. It consists of the following steps using morphological operations such as geodesic dilations (Serra, 1988) to estimate the geodesic distance map: 1) Estimation of the geodesic distance of each voxel of the medium X to the face A: ^ ImGeoDistForward 2) Estimation of the geodesic distance of each voxel of the medium X to the face B: ^ ImGeoDistBackward 3) Addition of both images: ImGeoDistForward + ImGeoDistBackward ^ ImAddFwdBwd 4) Infinum of both images: INF(ImGeoDistForward, ImGeoDistBackward) ^ ImInfFwdBwd Fig. 3. Estimation of the tortuosity into the white set between the top (blue) and the bottom (red) faces. The steps 1 and 2 calculate the geodesic distance of each pixel of the set X respectively to the top and to the bottom faces. After these two steps, the components in pink are eliminated because they are not connected to a marker-face and consequently not reached by the propagating fronts in the vertical Oy direction. The results of step 3, ImAddFwdBwd, is an image where the value of each pixel of the white component of X is the length of the geodesic path linking the two marker-faces and going through the corresponding pixel. However, the pixels in the green components of X are just linked to one marker-face and are then eliminated by steps 4 and 5, which isolate all the pixels belonging to the paths linking the two marker-faces. The pixels of the background are set to zero elsewhere. Finally the resulting image ImTortuosity, giving for each pixel the tortuosity of the shortest paths in which it is contained, is then normalized by the Euclidean distance between both marker-faces. w v\ r ......... INFLUENCE OF THE PROPAGATING STRUCTURING ELEMENT TWO DIFFERENT STRUCTURING ELEMENTS The geodesic dilations on a digitized image are morphological operations and then directly depend on the shape of the structuring element used (Serra, 1988). Previous publications (Soille, 1992; 1994; 2003; Coeurjolly etal., 2004) highlighted the influence of the propagating structuring element on the geodesic distance map. The images processed in the framework of the Silent Wall project are in 3D. That is why two 3-dimensional structuring elements have been compared, on the one hand the cube with 26 neighbors, and on the other hand the sphere. Considering the problem of acoustics handled in the Silent Wall project, the assumption is made that the wave fronts propagate only outwards in the direction perpendicular to the marker-faces and do not return to the source face. Thus the structuring elements are not isotropic. On the contrary, they are half cubes or half spheres. The Fig. 5 illustrates structuring elements with a radius equal to 15 voxels obtained from 3D dilations of the point-pattern shown in Fig. 4. (a) (b) Fig. 4. Pattern of points on the faces and at the center of a cube. (a) 3D view, (b) 2D projection of the point-pattern (red: visible points ; blue: invisible points ; green: central point invisible on the 3D view.) (a) (b) Fig. 5. 3D structuring elements of size 15 propagating in the Oz+ direction on the point-pattern of Fig. 4. (a) Half cubes, (b) Half spheres. SQUARES AND CUBES The 8-connectivity square in 2D We first used the 8-connectivity square and 26-connectivity cube to estimate the morphological tortuosity of fibrous media respectively for 2D and 3D images. However their shapes involve problems of inaccuracy because of their square corners, which do not correctly suit to estimate the geodesic distance between two faces of a sample. From a physical point of view, the cubic propagating fronts do not estimate a geodesic distance faithful to the definition illustrated in Fig. 2. The Fig. 6 shows how rough the estimation of the tortuosities in the white part represented in Fig. 3 can be, when it is processed with squares as structuring elements. The histogram of the tortuosities of this white part (Fig. 6c) shows that 45% of the pixels of the path have a tortuosity equal to 2.70, with a maximum tortuosity equal to 2.89. Moreover according to the Fig. 6b, the paths with a minimum tortuosity equal to 2.70 (in yellow) are physically incorrect because they do not follow the curves of the white part in Fig. 3. To sum up, the 2D square propagating front underestimates the geodesic distances and then underestimate the tortuosities. This is observable on the histogram which has consequently a high number of pixels with a tortuosity close to 1. This problem is observable in 3D with cubes as well. (a) (b) Tortuosity toward Oy into a path (by SQUARE) ,2 45 r CN a 40 g 35 I* ji 30 in £ 25 re a a) 20 sz o 15 Sä 10 0 1 5 .n ï 0 Tort Y PATH ; AVG: 2.721 ; std dev: 0.036 2.7 2.8 2.9 3 3.1 3.2 Tortuosity (c) Fig. 6. Estimation, from propagations of squares, of the tortuosities of the 2D white part of Fig. 3. (a) Forward propagation, (b) Image of the tortuosities (minimum tortuosity: 2.70 in yellow), (c) Histogram of the tortuosities. The 26-connectivity cube in 3D In 3D the cubic fronts involve a too high number of pixels having a tortuosity close to 1. Consider a straight composite tube composed of concatenated big and small cylinders (Fig. 7). The Fig. 7a represents a cropped 3D view of the real object in order to see the fronts inside it. Thus discontinuities of the fronts are introduced at the interfaces between big and small cylinders. Since the structuring element is cubic, these discontinuities do not deform the propagating fronts enough, that is why most of them look like plane waves especially in the first input cylinder on the left (Fig. 7b). As shown in Fig. 7c and Fig. 7d, 84% of the voxels have a tortuosity equal to 1 which makes the cube blind to the discontinuities of the composite tube, when it is used as propagating structuring element. (a) (b) (c) Tortuosity along a COMPOSITE TUBE (by CUBE) 90 80 70 60 50 40 30 20 10 0 Tort_TUBE ; AVG: 1.003 ; std_dev: 0.008 " 1 1.01 1.02 1.03 1.04 1.05 1.06 Tortuosity (d) Fig. 7. Tortuosity along a 3D discontinuous composite tube processed with cubes. (a) Forward propagation, (b) 2D projection of the forward propagation, (c) 2D projection of the tortuosities (minimum tortuosity: 1 in yellow), (d) Histogram of the tortuosities. FAST MARCHING DISCRETIZED DISCS AND SPHERES The square in 2D and the cube in 3D are irrelevant to estimate the morphological tortuosity from geodesic dilations. Intuitively, the disc in 2D and the sphere in 3D are the solutions to this problem. However both must be discretized on 2D or 3D lattices to be handled in the image processing algorithm. The fast marching method The fast marching was originally introduced by Sethian (1996). It consists of iteratively solving the Eikonal equation (Eq. 5) into a narrow band around the marker seed, with T (p) the arrival time at a point p of the propagating front starting from the marker seed Po (T(po) = 0), and f the cost function related to the speed of propagation: |VT|| = f . (5) The algorithm itself is precisely described and illustrated by Sethian (1996), Cohen and Kimmel (1997) and Petres et al. (2005). An implementation using hierarchical priority queues (algorithms 12 and 13) is proposed by (Peyrega, 2010). Moreover, if the cost function f = 1 inside the geodesic mask and if f = outside, then the speed is equal to 1 voxel per iteration, and the time of arrival T( p) at a point p inside the geodesic mask is equivalent to the geodesic distance U (p) between p and the marker seed inside the mask. Discs in 2D To be compared to Fig. 6a, the Fig. 8a represents the forward propagation from the top to the bottom of the white part represented in Fig. 3, obtained by successive geodesic dilations by discs. The fronts have circular shapes approximating the geodesic distance on the 2D discretized grid. The cost function can be compared to the refractive index n in geometrical optics (Cohen and Kimmel, 1997; Petres et al., 2005). Thus, the speed v(p) of the front at the point p can be written as a function of the celerity of light: v(p) = -¡(pp) = jjpj. In the case of this study, the cost function is homogeneous and equal to 1, which leads to fronts propagating at the speed of one pixel (in 2D) and one voxel (in 3D) per iteration. The fronts travel outwards and do not return to the source of the propagation. As explained by Sethian (1996), solving the Eikonal equation (Eq. 5) with the fast marching algorithm is made by solving the second order Eq. 6 in 2D and Eq. 7 in 3D for T(p), with fi,j and fi,jk, the cost functions respectively at the pixel (i, j) and at the voxel (i, j, k). We note Tij and Tij,k the arrival time T(p) at the point p respectively (i, j) in 2D and (i, j, k) in 3D. Thus, the algorithm only handles the 4-connectivity neighborhood in 2D and the 6-connectivity neighborhood in 3D of the voxels into the narrow band. {max{ [Tj - T-u] , [Tij - T+i,j] ,0})2+ 0max {[Tj - T',j-i] , [Tij - Tij+i] , °})2 = fi2 (6) i,j °max{ [Tijk - Ti-i,j,k\ , [Ti,j,k - Ti+i,j,k] ,°})2+ (max{ [Ti,jk - Tij-i,k] , [Ti,j,k - TiJ+i,k] ,°})2+ °max{ [Ti,j,k - Ti,j,k-i] , [Ti,j,k - Ti,j,k+i] ,°})2 = j (7) t; D fc l i r f y JS 4 if (a) (b) Tortuosity toward Oy into a path (by DISC) « 30 CM