This paper presents AVATREE, a computational modelling framework that generates Anatomically Valid Airway tree conformations and provides capabilities for simulation of broncho-constriction apparent in obstructive pulmonary conditions. Such conformations are obtained from the personalized 3D geometry generated from computed tomography (CT) data through image segmentation. The patient-specific representation of the bronchial tree structure is extended beyond the visible airway generation depth using a knowledge-based technique built from morphometric studies. Additional functionalities of AVATREE include visualization of spatial probability maps for the airway generations projected on the CT imaging data, and visualization of the airway tree based on local structure properties. Furthermore, the proposed toolbox supports the simulation of broncho-constriction apparent in pulmonary diseases, such as chronic obstructive pulmonary disease (COPD) and asthma. AVATREE is provided as an open-source toolbox in C++ and is supported by a graphical user interface integrating the modelling functionalities. It can be exploited in studies of gas flow, gas mixing, ventilation patterns and particle deposition in the pulmonary system, with the aim to improve clinical decision making.
Citation: Nousias S, Zacharaki EI, Moustakas K (2020) AVATREE: An open-source computational modelling framework modelling Anatomically Valid Airway TREE conformations. PLoS ONE 15(4): e0230259. https://doi.org/10.1371/journal.pone.0230259
Editor: Fang-Bao Tian, University of New South Wales, AUSTRALIA
Received: September 4, 2019; Accepted: February 25, 2020; Published: April 3, 2020
Copyright: © 2020 Nousias et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: The data underlying the results presented in the study are available from https://vessel12.grand-challenge.org/. The repository is now publicly available at https://gitlab.com/LungModelling/avatree. Furthermore, the outcomes of the presented pipeline are available at https://www.kaggle.com/vvrlabeceupatras/pone-avatree-results.
Funding: This work has been co‐financed by the European Regional Development Fund of the European Union and Greek national funds through the Operational Program Competitiveness, Entrepreneurship and Innovation, under the call RESEARCH – CREATE - INNOVATE Take-A-Breath, under grant agreement No. T1EDK-03832). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Competing interests: The authors have declared that no competing interests exist.
In the past years, a multitude of studies paves the way for the generation of patient-specific computational models of lung structure and function. Early studies focused on airway morphometry generating the first human bronchial trees models . These studies employed casts to decipher the relationship between bronchi lengths, branching angles and airway diameters . On this basis, researchers built and validated a simulation model of airway morphogenesis from generation 1 to generation 23 [3, 4]. Deterministic parameterized bronchial tree generation algorithms used as single input the location of the first one or two generations and the lung volume, extracted directly from computed tomography, thus constituting the core of patient-specific modelling [5–7]. Personalized boundary conditions based on diagnostic imaging were combined with generative approaches and lumped models of resistive trees [8, 9] constituting the state of the art in pulmonary system modelling. Later studies incorporated patient-specific boundary conditions into computational fluid dynamics to examine flow regimes, wall stresses and aerosol deposition. In the same direction, modelling the airflow in cases of constrictive conditions, such as asthma and chronic obstructive pulmonary disease (COPD) became feasible with the aforementioned approaches. Wall constriction and remodelling combined with patient-specific boundary conditions allowed the quantification of breathing conditions for asthmatic patients. Motivated by these advancements we introduce an end-to-end modelling approach that produces Anatomically Valid Airway tree conformations(AVATREE). Such conformations are adapted to personalized geometry and boundary conditions derived from diagnostic imaging and well-established airway extraction methods. Specifically, this study aims to provide an open-source simulation framework to (i) exploit imaging data so as to provide patient-specific representations (ii) perform structural analysis (iii) extend the segmented airway tree to predict the airway branching across the whole lung volume (iv) visualize probabilistic confidence maps of generation data (v) simulate bronchoconstriction to (vi) access patient-specific airway functionality (vii) perform fluid dynamics simulation in patient-specific boundary conditions to access pulmonary function.
1.1 Background & related work
While early studies focused mainly on quantitative modeling approaches to gain insight into the lung function without an explicit link to the lung’s structure, with the advancements in computing power and the current medical imaging capabilities, the interest in the simulation of lung function based on personalized geometric models that incorporate the essential structural features of the lungs, has significantly increased . By now, many studies propose the development and adoption of mathematical and geometrical models to study the structure of the airways and pulmonary physiology. Some address the problem of airway tree segmentation from CT images, while others analyze the branching patterns and bifurcations through airway morphometry or mathematical modelling. In this section, we briefly present representative approaches and introduce definitions for the different computational steps required during airway and pulmonary structure modelling and simulation. Airway segmentation, bronchial morphometry and tree branching, mathematical models of bifurcating distributing systems are required to derive patient-specific structural and functional modelling approaches.
Early studies on airway morphometry [11–13] used casts of human lungs to study branching patterns and the relation between airway lengths and diameters. The most commonly used conducting airway model has been Weibel’s symmetric model “A” . The airway position has also been described by Horsfield order  and Strahler order . Later on, with the advancement of medical imaging techniques, the extraction of airway structure and lung volume from imaging started to play an important role in the analysis of pulmonary diseases. A literature review on the analysis of lung CTs, including segmentation of the various pulmonary structures, can be found in , while a comparative study of automated and semi-automated segmentation methods of the airway tree from CT images was presented in . Overall, segmentation approaches can be classified into methods based on morphology , morphological aggregation , voxel classification , adaptive region growing with constraints [21–28], tube similarity [29, 30] and gradient vector flow . Several implementations of the aforementioned approaches are available in the literature. The tube segmentation framework  utilizing gradient vector flow  and the FAST heterogeneous medical image computing and visualization framework  utilizing the seeded region growing approach. AVATREE employs airway segmentation as a first step to obtain the personalized structure in the first generations, while the more advanced generations are simulated based on a tree extension algorithm.
Furthermore, mathematical models of the airway structure were formulated to derive branching and structural rules. Deterministic mathematical models of bifurcating distributing systems were examined  setting the basis for modelling bronchial tree branching as a function of available lung space . Deriving airway diameter as a relation of branching features facilitates full determination of the geometry given skeletal representations. Several studies mention scaling properties [33–36] for the airway diameters so that the average diameter D of a given airway at generation G is the product of the diameter of the trachea D0. Furthermore, Kamiya et al.  validated the relation between airway diameter and branching angles and, Kitaoka et al.  proposed a branching model allowing the prediction of the relationship between branching angle and flow rate and between airway length and diameter. Experimental studies verified the validity of the aforementioned methods. For the surface reconstruction of airway surface Tawhai et al. [5, 6, 38] employed fitting cubic Hermite surfaces as described in . The study of Hegedus et al.  generated surface models of idealized bifurcation through mathematical modelling rigorously extending the previous definitions . The aforementioned studies are relevant to our approach. To avoid the definition of special rules in the reconstruction of the surface of bifurcations we define the same boundary conditions, as the Poisson-reconstructed surface of a sampled point cloud.
Towards patient-specific structural and functional modelling, Tawhai et al. and Lin et al. [6, 42] studied the imposition of patient-specific boundary conditions to generate 1-dimensional and three-dimensional computational models taking into consideration the effects of turbulence. Towards the same direction, a review article  provides insight into multiscale finite element models of lung structure and function aiming towards a computational framework for bridging the spatial scales from molecular to the whole organ. Bordas et al.  developed an image analysis and modelling pipeline applied to healthy and asthmatic patient scans to produce complete personalized airway models to the acinar level incorporating CT acquisition, lung and lobar segmentation, airway segmentation and centerline extraction, algorithmic generation of distal airways and zero-dimensional models. Their implementation and results were included into Chaste framework , an open-source framework to facilitate computational modelling in heart, lung and soft tissue simulations. Towards the same direction, Montesantos et al.  presented a detailed algorithm for the generation of an individualized 3D deterministic model of the conducting part of the human tracheobronchial tree. With respect to the aforementioned studies, our work focuses on generating surface meshes of extended patient-based bronchial trees, suitable for computational fluid dynamics (CFD) simulations, along with a toolbox to simulate constriction of the airways.
Several authors employed CFD to investigate flow regimes in the human lung. In our previous work [45, 46] we performed narrowing deformations in CT extracted lung geometries to simulate constrictive conditions. Other studies in the same category include simulations for CT-based patient specific geometries [47–52], particle deposition [53–56], constrictive pulmonary diseases [45, 46, 57–59], micro-airway flow regimes , turbulence modelling , four-dimensional (space and time) dynamic simulations , ventilation heterogeneity , airflow in the acinar region . Validation studies conducted by Montesantos et al.  include morphometric studies on healthy and asthmatic patients providing among others, measurements of branching angles, length and diameter of airways as a function of generation. Such measurements are employed by our study for macroscopic validation of the generated trees.
1.2 Motivation and contributions
The objective in this field of research is to enable the prediction of gas flow [51, 55], gas mixing , heat transfer , particle deposition [46, 54, 66, 67], and ventilation distribution  in the pulmonary system. Lung ventilation patterns prediction [69, 70] can provide grounds for performance and fatigue estimation in high-frequency ventilation cases , disease severity quantification, such as in asthma and COPD, and give insight into drug delivery or even in transfer of harmful particulates. Motivated by the recent advances in this field and building upon previous work , we developed an end-to-end approach facilitating pulmonary structural modelling that is based on the definition of the personalised boundary conditions required for fluid dynamics simulations. Specifically, in this work we
- present an open-source simulation framework that utilizes imaging data to provide patient-based representations of the structural models of the bronchial tree,
- build and extend 1-dimensional graph representations of the bronchial tree,
- generate 3D surface models of extended bronchial tree models appropriate for CFD simulations
- generate probabilistic visualization of airway generations projected on the personalized CT imaging data, 2
- perform validation studies and provide comparison with relevant state-of-the-art approaches
- provide an open-source toolbox in C++ and a graphical user interface integrating modelling functionalities.
The rest of the paper is organized as follows. Section 2 analyzes the individual components of AVATREE, Section 3 commends on the results of our approach while Section 4 concludes this paper.
2 Materials and methods
The processing pipeline uses as input CT images and is presented in Fig 1. Airway segmentation is applied to the imaging data to extract a 3D surface mesh and a 1-dimensional representation of the airways. We employ the extended 1D graph to derive visualization of probabilistic airway generation labels in the space of the subjects’ anatomy as defined by the CT images and to generate a 3D surface defining personalized boundary conditions, that can be employed as input for computational fluid dynamics simulations.
2.1 Segmentation and airways centerline extraction
The input of the presented approach is unlabeled CT scans required to extract bronchial tree and airways structural features. For the definition of the lung volume, CT-based lung segmentation and annotation is required. For lung segmentation we employ the FAST heterogeneous medical image computing and visualization framework  is employed. The result of lung segmentation process is a binary mask visualized in Fig 1. As a next step, we perform further processing of the segmentation result to distinguish left and right lungs. The process is described below:
- A second region growing takes place starting from a single random point inside any of the segmented region only if all its immediate neighbours bare the same label.
- To advance the region growing front, all points neighbouring a candidate voxel must not include background voxel. This region is given a new label.
- Steps 1 and 2 are repeated for the other lung volume. The result is an image with three labels(background and two lung volumes).
- To distinguish left or right we employ the directed graph extracted from the main airways and follow the generic rule according to which the topological distance the topological distance between the bifurcations of the first and the second generation is longer in the left lung.
The next step involves the segmentation of the first generations of the airways that are identifiable in the patient’s CT image, but any available airway tree segmentation method can be also applied. For this purpose we investigated two algorithms. The first algorithm is the gradient vector flow [29, 31] which achieved high accuracy with low false-positive rate (only 1.44%) in a comparative study  in the context of the EXACT09 airway segmentation challenge. The second is a standard and stable approach based on seeded region growing . The former is included in the tube segmentation framework  and the latter in FAST heterogeneous medical image computing and visualization framework .
Let’s denote with I(x), , the gray level 3D medical image, where x = (x, y, z), x ∈ Ω is a voxel in the spatial domain of the volumetric imaging data. The output of the segmentation algorithm for the airways is a binary image SA of equal size with I. Likewise, the output of the segmentation algorithm for the lung volumes is a binary image SL of equal size with I. The result is presented in Figs 1 and 2, and utilized to generate prediction of full bronchial tree structures based on personalized lung volumes. To derive the centerline from SA a multitude of methods is provided in the literature including skeletonization or thinning. Fig 2 presents the up-to-four generations centerline of the airways.
This 1D representation of the bronchial tree is modelled by an undirected graph where is the set of vertices and is the set of edges. Each vertex, indexed by i, can be represented as a point vi = (xi, yi, zi). We denote the function N(vi) yielding the set of vertices indices neighbouring vertex i. The undirected graph is extracted by FAST framework  and converted into a directed graph with the following process. Initially, the graph starting point is defined as the one closest to the air inlet, i.e. the oral cavity or the trachea. Given index y the starting point for we generate the directed tree . We define as distal point the vertex of the graph with no children and distal branch the edge containing a distal point.
Algorithm 1 Detection of inlet in undirected graph
Output: Index of graph inlet y
1 procedure Derivation of graph inlet
2 Initialize set
3 for each vertex vi do
4 if |N(vi)| > 2 then
5 for each n ∈ N(vi) do
6 Initialize empty set
7 while N(vn)<3 do
8 for each m ∈ N(vn) do
9 if then
2.2 Generation of extended bronchial tree
Since higher generations cannot be identified from the personal imaging data, we extend the bronchial tree based on population-wise empirical observations. Initially the directed graph generated by the procedure explained in subsection 2.1 is pruned. Specifically, the extracted 1-dimensional representation is processed to include all the bifurcations located at the end of a given generation so as to facilitate the volume filling algorithm. Fig 1 shows the result of pruning where all generations after the nth have been pruned. The corrected tree is subsequently used for the bronchial tree extension. The generation process utilizes the bronchial tree extension algorithm initially proposed by Tawhai et al.  and later improved by Bordas et al.  while introducing a few safeguards to allow maximal space utilization. The bronchial tree extension algorithm can be described by the following steps.
For each lung subvolume and :
- Generate a point cloud sampling the subvolume with a uniform random process. Fig 3 depicts the uniform sampling of each lung subvolume with a total number of n = 30000 points [4, 6].
- Assign a seed point to the closest distal branch as presented in Fig 3.
- Calculate the center of mass of the sampled points as presented in Fig 3. (1)
- Employ principal component analysis (PCA) on the set of sampled points to define the splitting plane. The motivation for employing PCA is to address a space utilization aspect. The direction of the eigenvector with the greatest norm indicates the dimension of the data with the greatest variance denoting the direction where more space is available for the branches to grow. Picking a plane so that the resulting bounding box demonstrates the lowest possible variation, inhibits the appearance of very long branches. Given data points D = [p1 p1 p1⋯pn], A = DDT is the auto-correlation matrix. Direct singular value decomposition yields A = UΣUT where U = [u1 u2 u3]. Then the largest eigenvector is defined as um = max1≤i≤3 ui. Given the vector d expressing the direction of the distal airway, the splitting plane is described by center of mass c and vector d × [d × um]. The selected plane maximizes the available space for each new subdivision. Fig 4 presents a splitting plane splitting the set of points into two subdivisions.
- Calculate the centroid of each new subdivision.
- For each centroid define line segment starting from seed point extending 40% of the distance towards centroid of the subdivision.
- If a newly created branch is smaller that 2mm, it is considered as terminal.
- The process is repeated until no seed points remain.
- Any branch found outside the lung volume is removed along with children branches.
It is important to denote that the presented pipeline enables the generation of a tunable user-defined number of generations. If n is the number of desired generations, we set stopping criteria, in the extension of the bronchial tree until 2(n+1) bifurcations have been reached. The resulting 1D representation (Fig 5) predicts the location of the bifurcating distributive  structure given the patient-specific available space. The outcome of the volume filling algorithm will be used later to create maps that express the probability of a voxel to belong to a certain generation. This information when projected on CT slices can be a very informative and powerful clinical decision support tool.
2.3 Spatial probability maps of branching properties
The location of each new generation branch is calculated as explained before and provides a random sample out of all possible bronchial tree conformations. In this step of the proposed framework we produce probabilistic maps for each generation branch that provide estimates of the spatial probability to encounter a certain generation at some point of the imaging data. Such a probabilistic model allows to optimize clinical decision making by accounting for the branches’ distributional uncertainty.
Let’s denote with Wg(x), , the probability map for generation g where x = (x, y, z), x ∈ Ω is a voxel in the spatial domain of the volumetric imaging data. Then (2) where d is the distance of voxel x to the closest edge of labeled with generation g. Parameter σ is set experimentally to σ = 1. The extracted spatial map is overlaid on the CT scans, as shown in Fig 6, providing insightful visualization of spatial likelihood for each branching generation.
First column corresponds to axial view. Second column corresponds to coronal view. Third column corresponds to sagital view. The first row depicts raw imaging data, the second row presents the probabilistic maps for second generation, the third row presents the probabilistic maps for second generation and the fourth row presents the probabilistic maps for second generation.
2.4 Surface generation on predicted 1-dimensional representation
The extracted 3D geometries are required to conduct studies on computational fluid dynamics, particle transfer and deposition, ventilation, stress analysis and deformation simulations. Marching cubes algorithm  is a very well established method implemented in FAST  allowing the generation of 3D geometric models from airway segmentation label maps. The constriction simulation method aims to generate 3D tubular surface structures with smaller diameters. To this end, Laplacian surface contraction offers a solution that deforms the geometry pushing the vertices towards the direction of the inward normals.
The extension of the extracted centerline generates a predictive representation of the bronchial tree given the available space. However, for the outcome of space-filling algorithms to be useful in fluid dynamics simulation, particle deposition simulation or stress finite element analysis based studies, the boundary conditions in the form of triangular 3D meshes need to be defined. Initially, as a simplified approach, to define the diameter of each generation we can employ the power law consistent with Murray’s law of symmetric branching [33, 34]. (3) where d0 denotes the branch diameter of the trachea and dz the branch diameter for generation z.
Furthermore, if we take into account that each branch demonstrates different branching angle and diameter properties, the relation between airway diameter (d) and branching angles (θ) is based on the following rules validated by Kamiya et al.  and Kitaoka et al. : (4) (5) where the index 0 stands for the parent branch, and the indices 1 and 2 for the two children branches, respectively.
To reconstruct the lung surface we employ a point cloud sampling approach as input for Poisson surface reconstruction. The outcome is a smooth surface with smooth transitions instead of abrupt transitions in the intersection with the original tubular meshes. The tubular-shaped point cloud is sampled using a uniform random distribution. A clean-up step, visualized in Fig 7, ensures that no point can be found in distance less than the prescribed diameter of every available branch. The resulting point cloud is used to compute normals. A bilateral normal smoothing  function prepares the point cloud for Poisson surface reconstruction . smoothing the point normals. This step facilitates the surface reconstruction in bifurcations and transitional parts. Furthermore, since the directed graph is extracted where each point on the centerline corresponds to a point on the lung surface it is possible to further deform the surface with a custom function or pattern. The generated surface for seven and ten generations is presented in Fig 8.
Extra refinements remove the inner points facilitating normal estimation for Poisson surface reconstruction.
2.5 Simulation of constrictive pulmonary diseases’ effect on airway tree
This section aims to provide the methodology for simulation of broncho-constriction allowing to subsequently estimate the dynamic behaviour of the lung airways in the case of an exacerbation event. A bronchial tree 3D geometry is the input for this process yielding as output contracted airways. The proposed geometry contraction procedure is presented by Nousias et al.  and Lalas et al.  and is an extension of the work of Au et al.  facilitating a Laplacian smoothing process that shifts vertices along the estimated curvature normal direction. The airway geometric model consists of connected triangles forming the boundary conditions. Each triangular mesh can be described as where is the set of vertices, is the set of edges and is the set of faces constituting the 3D surface. Each vertex i can be represented as a point vi = (xi, yi, zi), ∀i = 1, 2, ⋯, N. For each face fi, ∀i = 1, 2, ⋯, l we denote the centroid (6)
The outward unit normal to the face fi (located at the centroid mi) is calculated as : (7) where are the vertices corresponding to face fi. Given the curvature flow Laplacian operator, the product δ = LV approximates the inward curvature flow normals . The motivation for employing the curvature flow Laplacian operator  on the mesh is that its output is not affected by mesh density. Specifically, (8) where Ai is the one-ring area, κi is the local curvature and ni is the inward curvature flow normal of the ith vertex.
The positions of the vertices satisfying LV = 0 result in a zero volume string-like mesh and can be used to simulate mesh contraction. However, since such an optimization problem has more than one solutions, further constraints are required . Introducing weighting matrices can smoothly move vertex positions towards the direction of the inward unit normal by iteratively solving the following minimization problem (9) where corresponds to the vertex positions before the contraction at each iteration.
The weighting matrices WH and WL regulate the mesh contraction and mesh attraction, respectively. Initially, we set them to and WH = I, where is the identity matrix, k a double constant experimentally tuned to 10−3 and A the average face area of the model.
Eq (9) can be expressed as (10)
After each iteration t we update the contraction and inflation weights to be used in iteration t + 1 so that and , where and are the original and the current one-ring area respectively. The Laplacian matrix for iteration t + 1, Lt+1 is also recomputed. On these grounds, to simulate broncho-constriction we require to reduce the airway diameter to a predefined level of narrowing is reached. This level is defined by certain termination criteria [45, 46]. Thus, a metric is required that measures the diameter of the bronchi under process. To estimate the degree of contraction of the airway’s geometry after each iteration, we employ a shape diameter function (SDF) based scheme  implemented in  that evaluates the local volume based on the estimated local diameter assigned to each face of the mesh, also known as raw SDF values. Measuring the volume before and after the Laplacian contraction iteration can set the termination criteria. Fig 9 presents a simulation of constrictive pulmonary conditions.
3.1 Dataset description
For the evaluation of the aforementioned approaches we employed the dataset provided by VESSEL12 (VESsel SEgmentation in the Lung) challenge  and EXACT09 . The VESSEL dataset is comprised of 20 anonymized scans in Meta (MHD/raw) format. The latter consists of 75 completely anonymized chest CT scans contributed by eight different institutions, acquired with several different CT scanner brands and models, using a variety of scanning protocols and reconstruction parameters. The conditions of the scanned subjects varied widely, ranging from healthy volunteers to patients showing severe abnormalities in the airways or lung parenchyma. Fig 6a to 6c present imaging instances of CT slices across the axial, coronal and sagittal planes. The generation of the initial airway surface, lung volume and 1-dimensional representation are performed using the FAST framework .
3.2 Structural modelling and validation
Our simulation framework processes the initial tree centerline and generates a structural estimation given the first three to four available generation and their morphometric characteristics i.e., lengths and diameters. To facilitate the comparison with morphometric data, we employed a publicly available dataset provided by Montesantos et al.  labelled as pone.0168026.s001. For the sake of self-completeness, the authors of  provided morphometric data extracted from HRCT images acquired at the University Hospital Southampton NHS Foundation Trust as a part of study described in [82, 83]. Data from seven healthy subjects and six patients with moderate or persistent asthma were included in the dataset. Asthmatic patients patients were diagnosed exacerbation-free for at least one month and were male non-smokers.
A Sensation 64 slice HRCT scanner (Siemens, Enlargen, Germany) was utilized to capture 3D images from mouth to the base of the lungs. Subjects were posed in supine position and were instructed to perform slow exhalation. Groundtruth data for the development of bronchial tree models in  were extracted by Pulmonary Workstation 2 Software including 3 to 4 generations in the upper lobes and 6 to 7 generations in the lower lobes. For each subject, a morphology file includes the total lung volume of the subject lung (in cm3) and the percent volume per lobe while a translation file contains the airway connectivity, starting from the trachea to the terminal nodes. We used the generated trees from  to validate our approach and compare our results with relevant literature findings. Specifically, we compared the distributions of diameters, airway lengths and branching angles for each generation and the total number of airways for Horsfield and Strahler orders.
In total 31204 acini were calculated being in agreement with the results reported by [6, 44]. Figs 10 and 11 present a comparison in terms of the number of airways for each level of Strahler and Horsfield orders. This comparison confirms that our model comes into agreement with pone.0168026.s001. Furthermore, distributions of airway lengths, branching angles and diameters were plotted for each generation, for AVATREE and pone.0168026.s001 . Airway lengths maintain the same exponential decay pattern for both models. Differences appear in generations 1 to 4 that are distinctively defined by body size and anatomical features. The distribution of branching angles of our model is also confirmed by pone.0168026.s001  maintaining a nearly linear decay with a very small rate. The distributions of diameters per generation are also observed to follow an exponential decay pattern. Both our model and pone.0168026.s001  decay similarly after generation 4 validating the morphometric characteristics of the airway trees generated by our approach. Figs 12 to 14 present the distribution of airway length, branching angle and diameter for each generation for AVATREE and for pone.0168026.s001 . Table 1 presents and overview of quantitative macroscopic figures for AVATREE and relevant studies. Branching ratios (RBH, RBS), diameter ratios (RDH, RDS) and length ratios RLH, RLS) were calculated for Strahler and Horsfield ratios denoted as *S and *H respectively. Specifically, RBH, RDH and RLH were calculated equal to RBH = 1.74, RDH = 1.259 and RLH = 1.26±1.01. Montesantos et al.  reported RBH = 1.56, RDH = 1.115 and RLH = 1.13 respectively. Additionally, RBS, RDS and RLS were calculated equal to RBS = 2.35, RDS = 1.25 and RLS = 1.23±1.02 and are close to the figures provides by relative studies [1, 44] as Table 1 reveals. Likewise, rate of decline for diameters per generation RD was calculated to RD = 0.83±0.21, being in agreement to . Average branching angle θ for our model was calculated to 32.44±28.95 comparable to  reporting a θ equal to 42.1±21.4. Finally, Figs 15 and 16 present bronchial tree 1-dimensional representations extended up to 12 and 23 generations respectively. Additionally, for both generated models the surface has been reconstructed for the first 7 generations.
Surface reconstruction was performed for the first 7 generations.
3.3 Open-source library & Graphical User Interface
The presented components of AVATREE are provided as an open-source solution publicly available at (https://gitlab.com/LungModelling/avatree) accompanied by a graphical user interface (GUI). The implemented application programming interface (API) includes the following modules, a) input-output functionalities, b) 1-dimensional representation tools including centerline extraction, graph generation, derivation of graph node properties c) bronchial tree extension tools extending the 1-dimensional representation to the desired number of generations, d) 3D surface generation and processing tools and e) airway narrowing simulation tools.
The GUI, presented in Fig 17, employs the set of functionalities defined by AVATREE and is comprised of four panels, namely data input and output panel, area selection panel, segmentation panel and broncho-constriction simulation panel. Through the GUI the user can load a 3D model, select the area to be processed, as Fig 18 visualizes, and use the narrowing functionalities to reduce the airway diameter by the desired percentage. The amount of narrowing depends on the number of iterations and contraction weight multiplier. In Fig 18 an airway of the first generation was constricted by 66%. The deformed surface introduced into computational fluid dynamics can provide insight into the breathing pattern and drug delivery in asthmatic lungs . In the segmentation panel, the surface faces can be classified based on local properties. The one illustrates the shape diameter function (SDF) , while the other one the 3D surface according to the generation number. The results are visualized in Fig 19.
Airway of second generation narrowed at 34% of original diameter.
In this paper, we presented AVATREE, an end-to-end approach modeling the subject-specific airway tree that defines the personalized boundary conditions required for the simulation of pulmonary function. This particular personalization aspect refers to the extraction of the main airways and the lung volumes from imaging allowing the simulation of a personalized extended bronchial tree. The utter goal in this category of studies is to eventually predict gas flow and particle distribution in healthy and constricted bronchial trees. Modelling lung ventilation patterns can provide grounds for performance and fatigue estimation in high-frequency ventilation cases and give insight into drug delivery or even transfer of harmful particulates. Specifically, this work presents an open-source simulation framework that utilizes imaging data to provide patient-specific representations of the structural models of the bronchial tree. The extended 1-dimensional centerline facilitates the generic estimation of pulmonary function through lumped 0-dimensional studies and allows the generation of probabilistic confidence maps of airway generation data. Such a visualization could be exploited by airway tree segmentation methodologies to improve the results further constraining the 3D space to be searched. Further elaborating on the benefits of the presented methodology, the generation of extended bronchial tree surface allows the assessment of airway functionality. Several studies available in the literature have employed computational fluid dynamics to predict flow and particle transfer patterns inside the conducting regions of the bronchial tree. Generating the 3D mesh constituting the surface defines the boundary conditions for this category of studies. Furthermore, surface deformation functionalities allow simulating broncho-constriction, which is the main feature in constrictive pulmonary diseases such as asthma and COPD. Existing approaches of medication adherence in asthma and COPD patients are usually based on the analysis of breathing signals acquired with acoustic sensors attached on inhaler devices  . The concept of such studies is to facilitate self-management by guiding the patients to improve their inhaler usage technique . AVATREE could contribute to this type of analysis by estimating the effectiveness of inhaled medication based on personalized imaging data and particle deposition simulations . Both automated and UI guided solutions are provided by the presented open-source solution enabling users to simulate pathological conditions in asthmatic patients guided by imaging priors data from healthy subjects.
- 1. Horsfield K. Morphometry of airways. Handbook of Physiology The Respiratory System III: American Physiological Society. 1986; p. 75–87.
- 2. Kitaoka H, Takaki R, Suki B. A three-dimensional model of the human airway tree. Journal of Applied Physiology. 1999;87(6):2207–2217. pmid:10601169
- 3. Wang C, Bassingthwaighte J, Weissman L. Bifurcating distributive system using Monte Carlo method. Mathematical and computer modelling. 1992;16(3):91–98. pmid:23015763
- 4. Tawhai MH, Pullan A, Hunter P. Generation of an anatomically based three-dimensional model of the conducting airways. Annals of biomedical engineering. 2000;28(7):793–802.
- 5. Tawhai MH, Burrowes KS. Developing integrative computational models of pulmonary structure. The Anatomical Record Part B: The New Anatomist: An Official Publication of the American Association of Anatomists. 2003;275(1):207–218.
- 6. Tawhai MH, Hunter P, Tschirren J, Reinhardt J, McLennan G, Hoffman EA. CT-based geometry analysis and finite element models of the human and ovine bronchial tree. Journal of applied physiology. 2004;97(6):2310–2321. pmid:15322064
- 7. Bordas R, Lefevre C, Veeckmans B, Pitt-Francis J, Fetita C, Brightling CE, et al. Development and analysis of patient-based complete conducting airways models. PloS one. 2015;10(12):e0144105. pmid:26656288
- 8. Ionescu C, De Keyser R. Parametric models for characterizing respiratory input impedance. Journal of medical engineering & technology. 2008;32(4):315–324.
- 9. Ionescu CM, Copot D, De Keyser R. Respiratory impedance model with lumped fractional order diffusion compartment. IFAC Proceedings Volumes. 2013;46(1):260–265.
- 10. Tawhai M, Clark A, Donovan G, Burrowes K. Computational Modeling of Airway and Pulmonary Vascular Structure and Function: Development of a “Lung Physiome”. Critical Reviews™ in Biomedical Engineering. 2011;39(4).
- 11. Haefeli-Bleuer B, Weibel ER. Morphometry of the human pulmonary acinus. The Anatomical Record. 1988;220(4):401–414. pmid:3382030
- 12. Phillips C, Kaye S, Schroter R. A diameter-based reconstruction of the branching pattern of the human bronchial tree Part II. Mathematical formulation. Respiration physiology. 1994;98(2):219–226. pmid:7817051
- 13. Pisupati C, Wolff L, Mitzner W, Zerhouni E. A central axis algorithm for 3D bronchial tree structures. In: Proceedings of International Symposium on Computer Vision-ISCV. IEEE; 1995. p. 259–264.
- 14. Weibel ER, Cournand AF, Richards DW. Morphometry of the human lung. vol. 1. Springer; 1963.
- 15. Huang W, Yen R, McLaurine M, Bledsoe G. Morphometry of the human pulmonary vasculature. Journal of applied physiology. 1996;81(5):2123–2133. pmid:8941537
- 16. Sluimer I, Schilham A, Prokop M, Van Ginneken B. Computer analysis of computed tomography scans of the lung: a survey. IEEE transactions on medical imaging. 2006;25(4):385–405. pmid:16608056
- 17. Lo P, Van Ginneken B, Reinhardt JM, Yavarna T, De Jong PA, Irving B, et al. Extraction of airways from CT (EXACT’09). IEEE Transactions on Medical Imaging. 2012;31(11):2093–2107. pmid:22855226
- 18. Irving B, Taylor P, Todd-Pokropek A. 3D segmentation of the airway tree using a morphology based method. In: Proceedings of 2nd international workshop on pulmonary image analysis; 2009. p. 297–07.
- 19. Fetita C, Ortner M, Brillet PY, Prêteux F, Grenier P, et al. A morphological-aggregative approach for 3D segmentation of pulmonary airways from generic MSCT acquisitions. In: Proc. of Second International Workshop on Pulmonary Image Analysis; 2009. p. 215–226.
- 20. Lo P, Sporring J, Ashraf H, Pedersen JJ, de Bruijne M. Vessel-guided airway tree segmentation: A voxel classification approach. Medical image analysis. 2010;14(4):527–538. pmid:20395163
- 21. Pinho R, Luyckx S, Sijbers J. Robust region growing based intrathoracic airway tree segmentation. In: Proc. of Second International Workshop on Pulmonary Image Analysis; 2009. p. 261–271.
- 22. Feuerstein M, Kitasaka T, Mori K. Adaptive branch tracing and image sharpening for airway tree extraction in 3-D chest CT. In: Proc. of Second International Workshop on Pulmonary Image Analysis. vol. 1; 2009. p. 1–8.
- 23. Fabijanska A. Results of applying two-pass region growing algorithm for airway tree segmentation to MDCT chest scans from EXACT database. In: The Second International Workshop on Pulmonary Image Analysis, CreateSpace, USA; 2009. p. 251–260.
- 24. Mendoza CS, Acha B, Serrano C. Maximal contrast adaptive region growing for CT airway tree segmentation. In: Proc. of Second International Workshop on Pulmonary Image Analysis; 2009. p. 285–295.
- 25. Van Rikxoort EM, Baggerman W, van Ginneken B. Automatic segmentation of the airway tree from thoracic CT scans using a multi-threshold approach. In: Proc. of Second International Workshop on Pulmonary Image Analysis; 2009. p. 341–349.
- 26. Weinheimer O, Achenbach T, Düber C. Fully automated extraction of airways from CT scans based on self-adapting region growing. Computerized Tomography. 2008;27(1):64–74.
- 27. Wiemker R, Bülow T, Lorenz C. A simple centricity-based region growing algorithm for the extraction of airways. In: Proc. Second International Workshop on Pulmonary Image Analysis (MICCAI). Citeseer; 2009. p. 309–314.
- 28. Tschirren J, Yavarna T, Reinhardt J. Airway segmentation framework for clinical environments. In: Proceedings of 2nd international workshop on pulmonary image analysis; 2009. p. 227–38.
- 29. Bauer C, Pock T, Bischof H, Beichel R. Airway tree reconstruction based on tube detection. In: Proc. of Second International Workshop on Pulmonary Image Analysis; 2009. p. 203–213.
- 30. Smistad E, Elster AC, Lindseth F. GPU accelerated segmentation and centerline extraction of tubular structures from medical images. International journal of computer assisted radiology and surgery. 2014;9(4):561–575. pmid:24177985
- 31. Bauer C, Bischof H, Beichel R. Segmentation of airways based on gradient vector flow. In: International workshop on pulmonary image analysis, Medical image computing and computer assisted intervention. Citeseer; 2009. p. 191–201.
- 32. Smistad E, Bozorgi M, Lindseth F. FAST: framework for heterogeneous medical image computing and visualization. International Journal of computer assisted radiology and surgery. 2015;10(11):1811–1822. pmid:25684594
- 33. Hagmeijer R, Venner C. Critical review of Murray’s theory for optimal branching in fluidic networks. arXiv preprint arXiv:181209706. 2018;.
- 34. Pepe VR, Rocha LA, Miguel AF. Optimal branching structure of fluidic networks with permeable walls. BioMed research international. 2017;2017. pmid:28607933
- 35. Varner VD, Nelson CM. Computational models of airway branching morphogenesis. In: Seminars in cell & developmental biology. vol. 67. Elsevier; 2017. p. 170–176.
- 36. Florens M, Sapoval B, Filoche M. An anatomical and functional model of the human tracheobronchial tree. Journal of Applied Physiology. 2010;110(3):756–763. pmid:21183626
- 37. Kamiya A, Togawa T, Yamamoto A. Theoretical relationship between the optimal models of the vascular tree. Bulletin of mathematical biology. 1974;36(3):311–323. pmid:4423763
- 38. Tawhai MH, Nash MP, Hoffman EA. An imaging-based computational approach to model ventilation distribution and soft-tissue deformation in the ovine lung1. Academic radiology. 2006;13(1):113–120. pmid:16399039
- 39. Fernandez J, Mithraratne P, Thrupp S, Tawhai M, Hunter P. Anatomically based geometric modelling of the musculo-skeletal system and other organs. Biomechanics and modeling in mechanobiology. 2004;2(3):139–155. pmid:14685821
- 40. Hegedűs CJ, Balásházy I, Farkas Á. Detailed mathematical description of the geometry of airway bifurcations. Respiratory physiology & neurobiology. 2004;141(1):99–114.
- 41. Heistracher T, Hofmann W. Physiologically realistic models of bronchial airway bifurcations. Journal of Aerosol Science. 1995;26(3):497–509.
- 42. Lin CL, Tawhai M, McLennan G, Hoffman E. Multiscale simulation of gas flow in subject-specific models of the human lung. IEEE Eng Med Biol Mag. 2009;28(3):25–33.
- 43. Mirams GR, Arthurs CJ, Bernabeu MO, Bordas R, Cooper J, Corrias A, et al. Chaste: an open source C++ library for computational physiology and biology. PLoS computational biology. 2013;9(3):e1002970. pmid:23516352
- 44. Montesantos S, Katz I, Pichelin M, Caillibotte G. The creation and statistical evaluation of a deterministic model of the human bronchial tree from HRCT images. PLOS one. 2016;11(12):e0168026. pmid:27977730
- 45. Nousias S, Lalos AS, Moustakas K. Computational modeling for simulating obstructive lung diseases based on geometry processing methods. In: International Conference on Digital Human Modeling and Applications in Health, Safety, Ergonomics and Risk Management. Springer; 2016. p. 100–109.
- 46. Lalas A, Nousias S, Kikidis D, Lalos A, Arvanitis G, Sougles C, et al. Substance deposition assessment in obstructed pulmonary system through numerical characterization of airflow and inhaled particles attributes. BMC medical informatics and decision making. 2017;17(3):173. pmid:29297393
- 47. Vial L, Perchet D, Fodil R, Caillibotte G, Fetita C, Preteux F, et al. Airflow modeling of steady inspiration in two realistic proximal airway trees reconstructed from human thoracic tomodensitometric images. Computer Methods in Biomechanics and Biomedical Engineering. 2005;8(4):267–277. pmid:16298849
- 48. De Backer J, Vos W, Gorlé C, Germonpré P, Partoens B, Wuyts F, et al. Flow analyses in the lower airways: patient-specific model and boundary conditions. Medical engineering & physics. 2008;30(7):872–879.
- 49. Luo H, Liu Y. Modeling the bifurcating flow in a CT-scanned human lung airway. Journal of Biomechanics. 2008;41(12):2681–2688. pmid:18667205
- 50. Yin Y, Choi J, Hoffman EA, Tawhai MH, Lin CL. Simulation of pulmonary air flow with a subject-specific boundary condition. Journal of biomechanics. 2010;43(11):2159–2163. pmid:20483412
- 51. Srivastav VK, Paul AR, Jain A. Computational Fluid Dynamics Study of Airflow and Particle Transport in Third to Sixth Generation Human Respiratory Tract. International Journal of Emerging Multidisciplinary Fluid Sciences. 2011;3(4).
- 52. Swan AJ, Clark AR, Tawhai MH. A computational model of the topographic distribution of ventilation in healthy human lungs. Journal of theoretical biology. 2012;300:222–231. pmid:22326472
- 53. Tian G, Hindle M, Lee S, Longest PW. Validating CFD predictions of pharmaceutical aerosol deposition with in vivo data. Pharmaceutical research. 2015;32(10):3170–3187. pmid:25944585
- 54. Miyawaki S, Hoffman EA, Lin CL. Effect of static vs. dynamic imaging on particle transport in CT-based numerical models of human central airways. Journal of aerosol science. 2016;100:129–139. pmid:28090122
- 55. Soni B, Aliabadi S. Large-scale CFD simulations of airflow and particle deposition in lung airway. Computers & Fluids. 2013;88:804–812.
- 56. Stylianou FS, Sznitman J, Kassinos SC. Direct numerical simulation of particle laden flow in a human airway bifurcation model. International Journal of Heat and Fluid Flow. 2016;61:677–710.
- 57. Verbanck S, Schuermans D, Vincken W. Small airways ventilation heterogeneity and hyperinflation in COPD: response to tiotropium bromide. International journal of chronic obstructive pulmonary disease. 2007;2(4):625. pmid:18268937
- 58. Sul B, Wallqvist A, Morris MJ, Reifman J, Rakesh V. A computational study of the respiratory airflow characteristics in normal and obstructed human airways. Computers in biology and medicine. 2014;52:130–143. pmid:25058489
- 59. Kim M, Bordas R, Vos W, Hartley RA, Brightling CE, Kay D, et al. Dynamic flow characteristics in normal and asthmatic lungs. International journal for numerical methods in biomedical engineering. 2015;31(12).
- 60. Lin CL, Tawhai MH, McLennan G, Hoffman EA. Characteristics of the turbulent laryngeal jet and its effect on airflow in the human intra-thoracic airways. Respiratory physiology & neurobiology. 2007;157(2-3):295–309.
- 61. Miyawaki S, Choi S, Hoffman EA, Lin CL. A 4DCT imaging-based breathing lung model with relative hysteresis. Journal of computational physics. 2016;326:76–90. pmid:28260811
- 62. Kumar H, Tawhai MH, Hoffman EA, Lin CL. The effects of geometry on airflow in the acinar region of the human lung. Journal of biomechanics. 2009;42(11):1635–1642. pmid:19482288
- 63. Montesantos S, Katz I, Fleming J, Majoral C, Pichelin M, Dubau C, et al. Airway morphology from high resolution computed tomography in healthy subjects and patients with moderate persistent asthma. The anatomical record. 2013;296(6):852–866. pmid:23564729
- 64. Hasler D, Anagnostopoulou P, Nyilas S, Latzin P, Schittny J, Obrist D. A multi-scale model of gas transport in the lung to study heterogeneous lung ventilation during the multiple-breath washout test. PLoS computational biology. 2019;15(6):e1007079. pmid:31206515
- 65. Karamaoun C, Sobac B, Mauroy B, Van Muylem A, Haut B. New insights into the mechanisms controlling the bronchial mucus balance. PloS one. 2018;13(6):e0199319. pmid:29933368
- 66. Kolanjiyil AV, Kleinstreuer C. Computationally efficient analysis of particle transport and deposition in a human whole-lung-airway model. Part I: Theory and model validation. Computers in biology and medicine. 2016;79:193–204. pmid:27810625
- 67. Kolanjiyil AV, Kleinstreuer C, Sadikot RT. Computationally efficient analysis of particle transport and deposition in a human whole-lung-airway model. Part II: Dry powder inhaler application. Computers in biology and medicine. 2017;84:247–253. pmid:27836120
- 68. Whitfield CA, Horsley A, Jensen OE. Modelling structural determinants of ventilation heterogeneity: A perturbative approach. PloS one. 2018;13(11):e0208049. pmid:30496317
- 69. Pozin N, Montesantos S, Katz I, Pichelin M, Vignon-Clementel I, Grandmont C. A tree-parenchyma coupled model for lung ventilation simulation. International journal for numerical methods in biomedical engineering. 2017;33(11):e2873.
- 70. Pozin N, Montesantos S, Katz I, Pichelin M, Vignon-Clementel I, Grandmont C. Predicted airway obstruction distribution based on dynamical lung ventilation data: A coupled modeling-machine learning methodology. International journal for numerical methods in biomedical engineering. 2018;34(9):e3108. pmid:29799665
- 71. Meyers M, Rodrigues N, Ari A. High-frequency oscillatory ventilation: A narrative review. Canadian journal of respiratory therapy: CJRT = Revue canadienne de la therapie respiratoire: RCTR. 2019;55:40. pmid:31297448
- 72. Adams R, Bischof L. Seeded region growing. IEEE Transactions on pattern analysis and machine intelligence. 1994;16(6):641–647.
- 73. Lorensen WE, Cline HE. Marching cubes: A high resolution 3D surface construction algorithm. In: ACM siggraph computer graphics. vol. 21. ACM; 1987. p. 163–169.
- 74. Zheng Y, Fu H, Au OKC, Tai CL. Bilateral normal filtering for mesh denoising. IEEE Transactions on Visualization and Computer Graphics. 2010;17(10):1521–1530.
- 75. Kazhdan M, Bolitho M, Hoppe H. Poisson surface reconstruction. In: Proceedings of the fourth Eurographics symposium on Geometry processing. vol. 7; 2006. p. 1–10.
- 76. Au OKC, Tai CL, Chu HK, Cohen-Or D, Lee TY. Skeleton extraction by mesh contraction. In: ACM transactions on graphics (TOG). vol. 27. ACM; 2008. p. 44.
- 77. Sorkine O, Cohen-Or D, Lipman Y, Alexa M, Rössl C, Seidel HP. Laplacian surface editing. In: Proceedings of the 2004 Eurographics/ACM SIGGRAPH symposium on Geometry processing. ACM; 2004. p. 175–184.
- 78. Nealen A, Igarashi T, Sorkine O, Alexa M. Laplacian mesh optimization. In: Proceedings of the 4th international conference on Computer graphics and interactive techniques in Australasia and Southeast Asia. ACM; 2006. p. 381–389.
- 79. Shapira L, Shamir A, Cohen-Or D. Consistent mesh partitioning and skeletonisation using the shape diameter function. The Visual Computer. 2008;24(4):249.
- 80. The CGAL Project. CGAL User and Reference Manual. 4.14 ed. CGAL Editorial Board; 2019. Available from: https://doc.cgal.org/4.14/Manual/packages.html.
- 81. Rudyanto RD, Kerkstra S, Van Rikxoort EM, Fetita C, Brillet PY, Lefevre C, et al. Comparing algorithms for automated vessel segmentation in computed tomography scans of the lung: the VESSEL12 study. Medical image analysis. 2014;18(7):1217–1232. pmid:25113321
- 82. Fleming J, Conway J, Majoral C, Katz I, Caillibotte G, Pichelin M, et al. Controlled, parametric, individualized, 2-D and 3-D imaging measurements of aerosol deposition in the respiratory tract of asthmatic human subjects for model validation. Journal of aerosol medicine and pulmonary drug delivery. 2015;28(6):432–451. pmid:25859710
- 83. Majoral C, Fleming J, Conway J, Katz I, Tossici-Bolt L, Pichelin M, et al. Controlled, parametric, individualized, 2D and 3D imaging measurements of aerosol deposition in the respiratory tract of healthy human volunteers: in vivo data analysis. Journal of aerosol medicine and pulmonary drug delivery. 2014;27(5):349–362. pmid:24400875
- 84. Das P, Nof E, Amirav I, Kassinos SC, Sznitman J. Targeting inhaled aerosol delivery to upper airways in children: Insight from computational fluid dynamics (CFD). PloS one. 2018;13(11):e0207711. pmid:30458054
- 85. Nousias S, Lalos AS, Arvanitis G, Moustakas K, Tsirelis T, Kikidis D, et al. An mHealth system for monitoring medication adherence in obstructive respiratory diseases using content based audio classification. IEEE Access. 2018;6:11871–11882.
- 86. Pettas D, Nousias S, Zacharaki EI, Moustakas K. Recognition of Breathing Activity and Medication Adherence using LSTM Neural Networks. In: 2019 IEEE 19th International Conference on Bioinformatics and Bioengineering (BIBE). IEEE; 2019. p. 941–946.
- 87. Polychronidou E, Lalas A, Tzovaras D, Votis K. A systematic distributing sensor system prototype for respiratory diseases. In: 2019 International Conference on Wireless and Mobile Computing, Networking and Communications (WiMob). IEEE; 2019. p. 191–196.