Keywords: Deep-Learning, Segmentation, Space-Filling Algorithm, 3D Modelling, Numerical Simulation, Respiratory System, Lung, Bronchial Tree, Deep-Dive Apnea Deep-Learning, Segmentation, Algorithme de Remplissage, Modélisation 3D, Simulation Numérique, Système Respiratoires, Poumon, Arbre Bronchique, Plongée en Apnée

An accurate description of the morphometry of the lung and airways, which are in line with the morphometric observations, is essential to perform numerical simulations related to the respiratory system. The lung is a complex organ, both because of its respiratory functions and of its particular structure. The airways are assembled together as a dichotomous tree with asymmetric bifurcations, that allows the transport of oxygen and carbon dioxide between the ambient air and the exchange surface with blood.

During the thesis, we focused on the creation of a tool to create 3D representations of the morphological structures of the lungs, lobes and bronchial tree. This tool is patient-dependant and is based on the use of thoracic CT scans. The resulting meshes are used for numerical simulations modelling the lung compression during breath-hold diving.

We first develop a 2.5D method for segmenting the lung lobes and the first generations of the bronchial tree. This algorithm is based on Deep-Learning methods, notably the U-Net architecture. We perform 2D segmentations of each slice for each axis (axial, coronal and sagittal) of the CT-Scan, allowing to compute a 3D matrix of predictions for each axis. Subsequently, we implemented a tool to combine and make the best of each prediction to generate 3D segmentations of the lung lobes and of the bronchi that are visible on the CT-Scans.

Next, we implement a new step by step algorithm to generate patient-specific 3D models of the medium and small airways that are not visible in the CT-Scans. This model is based on the works of Tawhai et al. and Kitaoka et al., which we combine and update to take advantage of each method. We also develop original methods to build the tree structure. The resulting model for the bronchial tree reproduces well the lung morphometry. Our method uses as input data 3D reconstructions of the morphological envelopes of the lung lobes and of the first two levels of airway bifurcations. The mesh of the lung envelope is decomposed step-by-step in sets of sub-volumes of decreasing sizes. An airway is generated for each sub-volume using an original method that is based on how air could feed each sub-volume in an optimal way. The result is a hierarchical decomposition of the mesh of the lung volume and the mesh of the generated airway tree. The statistics of the airway tree resulting from our algorithm is validated against sets of morphometric data from the literature. The meshes resulting from our algorithm are generated to be directly usable by classical numerical methods, such as finite elements or finite volumes.

Finally, we study the compression of the lungs during breath-hold diving, where the respiratory system is submitted to extreme conditions such as high water pressure. We define a system of equations that models the effect of the dive on the lung, and then perform numerical simulations using finite elements to refine our predictions. The results of these simulations are used to predict the lung volumes during the descent and to evaluate the effect of an emblematic phenomenon occurring during deep diving, called the "blood shift". The "Blood Shift" is a physical and physiological reaction of the body whose effect is to redirect the blood flow to vital organs (brain, heart and lungs), de facto protecting them from hypoxia and high pressure. These numerical simulations provide a visual representation of the compressed lungs throughout the dive and allow to determine a first order of magnitude of the stress suffered by the lung during deep diving.

This work allows to build a whole, realistic, personalized model of the lung and to better understand its physiology, such as during apnea diving.

Une description précise de la morphométrie du poumon et des voies respiratoires, conforme aux observations morphométriques, est essentielle pour réaliser des simulations numériques liées au système respiratoire. Le poumon est un organe complexe, tant par ses fonctions respiratoires que par sa structure particulière. Les voies respiratoires sont assemblées sous la forme d'un arbre dichotomique avec des bifurcations asymétriques, qui permet le transport de l'oxygène et du dioxyde de carbone entre l'air ambiant et la surface d'échange avec le sang.

Cette thèse se concentre sur la création d'un outil permettant de créer des représentations 3D des structures morphologiques des poumons, des lobes et de l'arbre bronchique. Cet outil est dépendant du patient et est basé sur l'utilisation de scanners thoraciques. Les maillages obtenus sont utilisés pour des simulations numériques modélisant la compression des poumons lors de la plongée en apnée.

Nous avons développé une méthode 2.5D pour segmenter les lobes pulmonaires et les premières générations de l'arbre bronchique. Cet algorithme est une méthode de Deep-Learning, notamment l'architecture U-Net. Nous effectuons des segmentations 2D de chaque coupe pour chaque axe (axial, coronal et sagittal) du CT-Scan, permettant de calculer une matrice 3D de prédictions pour chaque axe. Ensuite, nous avons implémenté un outil permettant de combiner et d'optimiser chaque prédiction pour générer des segmentations 3D des lobes pulmonaires et des bronches visibles sur les CT-Scan.

Ensuite, nous avons implémenté un nouvel algorithme déterministe pour générer des modèles 3D spécifiques au patient des voies respiratoires moyennes et petites qui ne sont pas visibles sur les CT-Scans. Ce modèle est basé sur les travaux de Tawhai et al. et Kitaoka et al., que nous combinons et mettons à jour pour tirer parti de chaque méthode. Nous développons également des méthodes originales pour construire l'arborescence. Le modèle de l'arbre bronchique obtenu s'inscrit bien la morphométrie du poumon. Notre méthode utilise comme entrée des reconstructions 3D des lobes pulmonaires et des deux premiers niveaux de bifurcations des voies aériennes. Le maillage de l'enveloppe pulmonaire est successivement décomposé en ensembles de sous-volumes de tailles décroissantes. Une branche est générée pour chaque sous-volume à l'aide d'une méthode originale qui se base sur la flux d'air alimentant chaque sous-volume de façon optimale. Le résultat est une décomposition hiérarchique du maillage du volume pulmonaire et la création d'un maillage de l'arbre bronchique. Les statistiques de l'arbre bronchique généré sont en accord avec l'ensembles de données morphométriques de la littérature. Les maillages obtenus par notre algorithme sont directement utilisables par des méthodes numériques classiques, telles que les éléments finis ou les volumes finis.

Enfin, nous étudions la compression des poumons lors de la plongée en apnée, où le système respiratoire est soumis à des conditions extrêmes telles qu'une pression d'eau élevée. Nous définissons un système d'équations qui modélise l'effet de la plongée sur le poumon, puis nous effectuons des simulations numériques à l'aide d'éléments finis pour affiner nos prédictions. Les résultats de ces simulations sont utilisés pour prédire les volumes pulmonaires pendant la descente et pour évaluer l'effet d'un phénomène emblématique se produisant pendant la plongée profonde, appelé le "blood shift". Le "Blood Shift" est une réaction physique et physiologique du corps dont l'effet est de rediriger le flux sanguin vers les organes vitaux (cerveau, cur et poumons), les protégeant de facto de l'hypoxie et de la haute pression. Ces simulations numériques fournissent une représentation visuelle des poumons comprimés et permettent de déterminer un premier ordre de grandeur du stress subi par le poumon lors de la plongée profonde.

Ce travail permet de construire un modèle complet, réaliste et personnalisé du poumon et de mieux comprendre sa physiologie, notamment lors de la plongée en apnée.

ń Tout ce que nous avons à décider, c'est ce que nous devons faire du temps qui nous est imparti. ż Le Seigneur des Anneaux, Tome 1 : La Communauté de l'Anneau de J.R.R. Tolkien Jai consacré cinq années à ce projet, cinq années qui ont changé ma vision du monde, ma façon dêtre et mes motivations dans la vie. Cette thèse, cest un peu comme la Quête de lAnneau, lidée de faire une thèse ne m'était jamais venue lorsque jai commencé mes études dingénieur. Puis, il y a cinq ans, jai fait la connaissance de Gandalf ou plutôt André, qui ma proposé un projet lors dun stage de M1, pour finalement aboutir sur ce précieux manuscrit, ma thèse.

Au début, il s'agissait de modéliser les mouvements d'une main, puis André m'a présenté Benjamin et sa thématique de recherche, la respiration. C'est là que mon travail sur la modélisation du système respiratoire a commencé, lors de mon projet final d'étude, et depuis je n'ai cessé de travailler sur ce thème. Quand je revois mes premiers modèles 3D des poumons et ceux que je présente aujourd'hui dans ce manuscrit, je comprends mieux l'étendue du voyage, un voyage rythmé par des hauts et de bas, des moments de joie, de doutes. Jai eu la chance de découvrir le bout du monde en Nouvelle-Zélande, pour ensuite passer une année de stress à essayer d'obtenir un financement, et finalement commencer cette thèse il y à maintenant 3 ans. Jai fait la connaissance de personnes formidables, qui mont soutenues, qui mont aidées à faire de cette thèse ce quelle en est aujourdhui. Benjamin Mauroy, et Angelos Mantzaflaris, mes directeurs de thèse. Merci pour ce temps passé ensemble, pour la confiance que vous mavez donnée, pour votre bienveillance et votre gentillesse. Vous êtes des chercheurs modèles, votre ouverture à toutes les disciplines scientifiques m'a permis de grandir dans le monde de la recherche et daller dans des domaines peu familiers. Merci Benjamin pour mavoir accompagné dans la compréhension du système respiratoire. Merci Angelos pour avoir été à lécoute dans les moments compliqués avec mon code et mavoir aidé à trouver les solutions pour laméliorer et maméliorer, en même temps, dans ma façon de travailler.

Je remercie aussi André Galligo, linstigateur de toute cette histoire, pour mavoir offert lopportunité de travailler sur cette thématique, pour nos discussions dont on savait quand elles commençaient mais jamais quand elles finissaient, pour toutes ces idées qui mont permis dexplorer de nouveaux domaines détudes. Sans cette rencontre, je naurais pas eu la chance de réaliser tout ce travail, alors encore une fois merci infiniment. Je tiens à remercier les membres de léquipe poumon, Michael, Jonathan, Valentin, Frédérique, Cyril et Riccardo, avec qui jai passé de très bons moments à la fameuse pause-café du laboratoire, aux repas ou encore aux conférences. Frédérique, Cyril, Riccardo et Alexis, partager le bureau avec vous était un réel plaisir, les longues discussions que lon a eues dans ce bureau vont me manquer.

Je remercie les doctorants et les post-docs que jai pu côtoyer pendant ce temps passé au laboratoire, et plus particulièrement Thibault pour ces discussions autour de la F1. Un grand merci aussi à Mariam, travailler et discuter avec toi était un réel plaisir.

Jean-Marc Lacroix et Roland Ruelle, merci davoir été patient avec moi et à lécoute de mes problèmes sur les machines de calcul du labo, vous avez grandement contribué aux résultats que jai obtenus.

Un grand merci à tous mes amis. Rémi et Jade, mes amis de toujours, vous avez été dun soutien indéfectible, je ne pourrais dire combien de bière on a pu partager ensemble, mais chaque instant avec vous est unique. Arnaud et Mathias, Polytech nous a fait nous rencontrer, et le reste ce sont des moments formidables passés ensemble, entre les journées au ski, les sessions de jeux, les soirées avec Adrian, Océane, Étienne, Sarah, et Charlotte. Merci à vous pour avoir partagé votre bonne humeur avec moi. Laskar merci pour les souvenirs à Dax. Les fêtes avec Arnaud resteront historiques. Hugo, nos foots en bas de la rue sont des souvenirs intemporels et gravés dans le mur. Clémentine, tu as beau avoir un nombre infini de surnoms, tu nen restes pas moins singulière, et merci de partager ces ramens avec moi.

Enfin je souhaite remercier ma famille. Mon frère, Jonathan, je ne sais pas comment tu as pu me supporter quand jétais plus jeune, mais je ten suis reconnaissant. Alexia et toi avez fait de moi un tonton pendant cette thèse, et ça a été une réelle bouffée dair. Il ny a pas de mots pour décrire le bonheur et la joie de voir la bouille de Charlie et son sourire permanent. Papa et Maman, même si je sais que vous nallez pas comprendre tout ce quil y a dans cette thèse, sans vous il ny aurait même pas de thèse. Les derniers instants de celle-ci nont pas été faciles pour moi, et vous avez été là dans ces moments et mavez aidé à aller de lavant. Quels que soient mes choix et décisions vous avez toujours été là pour me soutenir et mencourager. Chaque jour je mesure un peu plus la chance que jai de vous avoir à mes côtés. Merci pour votre amour. Nowadays, digital resources and tools are constantly evolving, and their use in scientific research is following the same progression. Digital simulations are a good example of this progression, they are becoming more and more complex and allow to be extremely close to reality. These simulations are increasingly used to understand the phenomena governing the function of the human body. The functioning of the human body is so complex that new discoveries are made almost every day. This is the case for the respiratory system and, more particularly, the lung, for which, for example, cancers, cystic fibrosis, asthma or, more recently, SARS-CoV-2 virus (Covid- [START_REF] Denotter | Hounsfield Unit[END_REF], is a major subject of study. The role of the lung is to transport oxygen and carbon dioxide between the ambient air and the exchange surface with blood.

Chapter 1

During inhalation, the lungs carry oxygen to the blood, remove carbon dioxide from the blood and release it into the ambient air during exhalation. Gas exchange takes place in the alveoli and is made possible thanks to a large network of ducts, called the Bronchial Tree. The bronchial tree is one of the organ with the most complex morphological structure of the human body. It is a quasi-dichotomous tree contained in the lungs.

The main objective of this work is to develop a tool to generate 3D models of the lungs and bronchial tree adapted to each person from medical images. In addition, we were interested in how the human body reacts under extreme conditions. We therefore worked on numerical simulations modelling a breath-holding descent where the body, and in particular the lungs, are subjected to high pressures.

The aim of this chapter is to describe the physiology and morphology of this complex system in order to better understand the complexity of obtaining accurate and realistic numerical models of these structures. We will also introduce freediving in competition with the different practices and factors determining performance in order to better understand lung physiology under high environmental pressure.

Human lung

In this section we will present some anatomy and physiology of the respiratory system and the influence of certain pathologies on the lungs and the bronchial tree. The introduction of the chapters on segmentation and generation of the bronchial tree will contain the corresponding review of the literature.

Anatomy and main features

Oxygen (O 2 ) is a main component for the proper functioning of human and mammals in general. Oxygen enables cellular respiration and energy production via the cellular mitochondria. However, this transformation releases carbon dioxide (CO 2 ) which must then be evacuated. In order to transport oxygen to the muscles and organs, as well as carbon dioxide, the human body relies on two closely related structures: the lungs, which are the interface between the ambient air and the blood, which transports the various gases throughout the human body.

A healthy human has two lungs, the right and the left. These lungs are protected by the rib cage and rest on the diaphragm, which is a skeletal muscle that separates the thorax from the abdomen and assists in the respiratory process. Each lung can be divided into lobes, with 3 lobes for the right lung and 2 lobes for the left lung, this difference being due to the position of the heart which is located on the left side. The thoracic cage is made up of twelve pairs of ribs that form an arc and join the spine to the sternum. The pleura is a serous membrane and is located between the rib cage and the lungs. This membrane secretes a lubricating fluid which reduces friction caused by the movements of the breath.

During its stay in the human body, oxygen will explore different regions of the body. It begins its journey through the mouth or nose, which then carries it to the pharynx and larynx and continues to the trachea and the pulmonary tree. The trachea is a long, elastic, fibrocartilaginous tube, which divides into two narrower tubes, one for the right lung and one for the left lung. These tubes are called pulmonary bronchi. Oxygen is then transported through new dichotomous bifurcations leading to smaller and smaller bronchi, which are called bronchi, then bronchioles, next terminal bronchioles and finally respiratory bronchioles. The respiratory bronchioles are the first element of the acini, which are the site of gas exchange with the blood. An acinus therefore consists in the respiratory bronchioles, the alveolar ducts and finally the alveoli. The alveoli are cavities whose membrane is lined with blood capillaries. The blood is both loaded with oxygen for distribution to other organs and muscles, and discharged of carbon dioxide. The carbon dioxide goes up, by the reverse path of the oxygen, to be exhaled into the ambient air.

Pulmonary Tree

The pulmonary tree designates the network linking the larynx to the alveoli. The trachea is the trunk of the pulmonary tree, and divides into two smaller branches, which correspond to the pulmonary branches. The passage between the trachea and the pulmonary branches is called a bifurcation. A bifurcation consists of a parent branch, in this case the trachea, and daughter branches, in this case the pulmonary branches. The angle formed between the parent branch and a daughter branch is called the branching angle. The daughter branches do not necessarily have the same diameter, length or branching angle, so we talk about asymmetry. The pulmonary tree is a succession of asymmetrical bifurcations, which are most often dichotomous. It is also possible to observe trichotomies, but these are considered to be a succession of dichotomous bifurcations [START_REF] Ewald | Morphometry of the Human Lung[END_REF][START_REF] Haefeli-Bleuer | Morphometry of the human pulmonary acinus[END_REF][START_REF] Horsfield | Morphology of branching trees related to entropy[END_REF]. The set of branches obtained after the same number of bifurcations constitutes a generation.

The pulmonary tree can be divided into two parts: a conductive part where there is no gas exchange, called the bronchial tree, and a respiratory part where gas exchange takes place, called the acini. The number of generations between the trachea and an acinus varies from one acinus to another, this number varies between 18 and 30 generations, with an average of 23 generations [START_REF] Ewald | Morphometry of the Human Lung[END_REF][START_REF] Haefeli-Bleuer | Morphometry of the human pulmonary acinus[END_REF].

Bronchial Tree

The bronchial tree is composed of the airways that are not involved in gas exchange, i.e. on average the first 17 generations of the pulmonary tree [START_REF] Ewald | Morphometry of the Human Lung[END_REF]. This part is often called the conducting zone or the anatomic dead space, and the bronchi present in this zone are then the conducting bronchi, with a total volume of about 150 ml. Their cylindrical structure only allows the transport of oxygen or carbon dioxide respectively from the ambient air to the respiratory zone and vice versa. Along these 17 generations, the length and diameter of the bronchi decrease as the generation increases. Furthermore, daughter branches, originating from the same dichotomous bifurcation, are not necessarily identical, and this difference can be estimated by comparing morphometric parameters between the parent and daughter branches. This difference is more important in the first generations, to adapt to the thoracic volume and to bypass the heart. In the last generations, the bifurcations become more and more similar.

Different works [START_REF] Murray | The Physiological Principle of Minimum Work[END_REF][START_REF] Mauroy | Interplay between Geometry and Flow Distribution in an Airway Tree[END_REF][START_REF] Mauroy | An optimal bronchial tree may be dangerous[END_REF] have proposed symmetrical models with a homothetic factor, whose value is close to 2 -1 3 and so the diameter of a daughter branch d 1 is related to the diameter of the mother d 0 with d 1 = 2 -1 3 d 0 . The way the gas is transported depends on the generation : by convection or diffusion. In the proximal and central parts of the bronchial tree, transport is by convection, and a transition to diffusion occurs as one progresses towards the distal part.

It is easy to understand the complexity of working with and even of obtaining a representation of the bronchial tree. Thus, the first representations are simplified symmetrical forms like the one presented by Weibel, which is based on the homothety ratio h = 2 -1 3 . The subdivisions are perfectly symmetrical, and the geometric parameters are obtained with the ratio. Nevertheless, each person is unique, and it is complicated to define a single model of the bronchial tree. At the end of the second millennium, two models for generating the bronchial tree based on the morphological structure of the lungs were used. The first to have been published, was proposed by Kitaoka et al. [START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF] with the objective of optimizing gas transport in the bronchial tree. The examples given were in less complex structures of the lungs. The second approach is more geometric and relies much more on lung representations. It was proposed by Tawhai et al. [START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF][START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Merryn | CT-based geometry analysis and finite element models of the human and ovine bronchial tree[END_REF] and is still the most widely used for generating a 3D model of the bronchial tree.

Respiratory zone

The respiratory zone consists in the regions involved in gas exchange and is often referred to as the pulmonary acinus. Like the bronchial tree, the acini have a dichotomous tree structure with, on average, 7 generations and represent about 90% of the total volume of the lung. They are composed of the respiratory bronchioles in the first 3 generations, then the alveolar ducts in the next 3 generations, and finally the alveolar sacs in the last generation. As the generation increases, more and more alveoli line the walls of the tubes until they completely cover the surface of the alveolar sacs and their grape-like structure.

In this part of the pulmonary tree, air is transported by diffusion to the alveoli, which are then in contact, via a membrane, with the blood capillaries. This membrane is about 0.2 µm to 0.5 µm thick [START_REF] Michael | Pulmonary physiology[END_REF] and has a total surface area of about 100 m 2 .

Breathing

The transport of gases through the pulmonary tree involves a well-known mechanism of the human body, breathing. During this breathing cycle, gas exchanges with the blood regulate its concentration of oxygen and carbon dioxide. Ventilation can be divided into two phases, the inspiratory phase and the expiratory phase. During inspiration, the volume of the lung increases, creating a pressure negative difference between the acini and the surrounding air, i.e. the pressure in the acini is lower than that in the surrounding air. Air then moves to the region of lower pressure, creating an airflow. The acini are then filled with fresh air and the blood is charged with oxygen. The expiratory phase is the opposite, the volume of the lungs decreases and the pressure in the acini is higher, which draws air outwards, air that has previously been concentrated in carbon dioxide from the blood.

At rest, only the inspiratory phase is muscularly active, involving mainly the muscles of the thorax, such as the diaphragm. The diaphragm is a muscle attached to the bottom of the lungs, which when contracted, will move downwards and force the lungs to stretch, increasing their volume thanks to their elasticity. At the same time, the intercostal muscles also produce an effort to allow the ribs to move outwards. As the ribs are connected to the lungs by the pleura, they will, as with the diaphragm, also be stretched outwards. The inspiration lasts on average 2 seconds. Conversely, exhalation, at rest, is a muscularly passive phenomenon. After inspiration, the lungs are filled with air and the elastic lung tissue is stretched and has stored elastic energy. As the equilibrium position of the lungs and thorax is the position before inspiration, the relaxation of the thoracic muscles leads to an elastic recoil which will generate a compression of the lungs and force the air out. Despite the passive nature of exhalation, muscles are still involved, to a lesser extent, to hold the movement of the lungs during exhalation, which lasts on average 3 seconds. During physical exertion, exhalation becomes active as the chest muscles are more involved in holding the lungs back.

Generally, ventilation is represented by the flow rate of inspired or expired air, which is expressed often in mL/s and can be used to measure certain lung volumes. The volume of air inspired or exhaled is called the tidal volume and, at rest, it averages 500mL. This means that if we remove the volume of the dead space ( 150 mL), the effective volume, which will be used for gas exchange, is 350 mL. Other important volumes can be estimated with a spirometer by measuring these airflows. For example, the total volume of air that can be contained in the lungs, known as the total lung capacity (TLC), or the volume of air that is still present in the lungs when you exhale normally, known as the functional residual capacity (FRC). By forcing exhalation, an estimate of the residual volume (RV) can be defined, which corresponds to the minimum volume contained in the lungs to prevent the alveoli from collapsing. The difference between TLC and RV is the vital capacity (VC). Measurements of these different volumes can be useful in detecting certain conditions, such as asthma.

Volume

Elastic properties of lung tissue

In freediving, which we discuss next, breathing and airflow are not present. It is a static case where the lungs are filled with a given quantity of air. The air in the lungs produces a pressure that pushes on the flexible alveoli walls and that opposes the water pressure at the outside. The lung volume is then the consequence of the balance between these two pressures and is determined using a physical quantity called the static compliance. The lungs static compliance links the lung volume variations with the pressure gradient between the alveoli and the lung tissue pressure. Agostoni et al. [START_REF] Agostoni | Static Behavior of the Respiratory System[END_REF] studied the relationship between lung volumes and pleural pressures in a static regime. The curve in the Figure 1.6 represents this relationship. The slope of the curve corresponds to the pulmonary compliance. This work will be useful for the numerical simulations to deduce the Young's modulus (the modulus of elasticity) associated with the lung tissues. [START_REF] Agostoni | Static Behavior of the Respiratory System[END_REF]. Taken from [START_REF] Mauroy | Toward the modeling of mucus draining from human lung: role of airways deformation on air-mucus interaction[END_REF]. Respiratory system pressure: pressure difference between the thorax and the alveoli. Lung pressure: pressure difference between the alveoli and the pleural pressure (= pressure at the walls of the lungs). 1cmH 2 O=100Pa

Model of Human Lung

We have showed that the lungs and the bronchial tree have a complex structure. In the past, information on their structure and morphometric properties was obtained through Ex-Vivo studies [START_REF] Ewald | Morphometry of the Human Lung[END_REF][START_REF] Horsfield | Morphology of the bronchial tree in man[END_REF]. With the advances in technology, the study of the lung has gone digital and In-Vivo with medical imaging.

Segmentation of lung

The use of medical images is an important aid for doctors in making a diagnosis of injuries or diseases. Medical imaging includes different types of examinations, such as X-rays, CT scans, MRIs and ultrasound scans. Quantitatively, there may be a lot of information given by medical image, therefore the operator needs to be extremely focused to analyse the image. Because of this quantity of information, automatic or almost automatic analysis of medical images is a crucial area for research.

Early in the 1970s, techniques for recognizing lines and edges and using mathematical frameworks to create algorithm for specific works were introduced. Later, supervised techniques like active shape algorithms, statistical classifiers, etc. helped to improve the algorithms [START_REF] Litjens | A survey on deep learning in medical image analysis[END_REF]. Deep learning techniques using convolutional neural networks have surpassed other algorithms in recent years, especially in the last ten years, for image classification, organ recognition, registration, and segmentation [START_REF] Garcia-Garcia | A survey on deep learning techniques for image and video semantic segmentation[END_REF][START_REF] Litjens | A survey on deep learning in medical image analysis[END_REF][START_REF] Akkus | Deep Learning for Brain MRI Segmentation: State of the Art and Future Directions[END_REF].

In this thesis, we are working on the extraction of information on the position of the lungs and the bronchial tree from CT-Scans. For this, we used a segmentation algorithm. Segmentation consists of algorithms that create sets of pixels. These sets are defined according to parameters such as the value or the texture of the pixels. These sets can be linked to certain areas or objects in the image [START_REF] Garcia-Garcia | A survey on deep learning techniques for image and video semantic segmentation[END_REF], such as an organ, a color, etc. These objects are referred to a class. The algorithms transform the images to make their analysis easier. If the algorithm is not correctly chosen or executed, the analysis can be more complicated or even wrong. However, there is no standardized approach for this difficult task.

In the literature, different types of algorithms can be found: : the thresholding-based segmentation, the boundary-based segmentation, the region-based segmentation, the hybrid-based segmentation, and the deep-learning based segmentation [START_REF] Waseem | A survey: Image segmentation techniques[END_REF][START_REF] Zaitoun | Survey on Image Segmentation Techniques[END_REF][START_REF] Dzung | A survey of current methods in medical image segmentation[END_REF]. For the segmentation work we have done, we have focused on deep learning algorithms. The segmentation algorithms via deep learning are based on two principles, classification and detection. Aiming to identify one or more classes that may be present in an entire image, image classification seeks to establish that an image is a visual representation of one or more items. Object detection methods give a first indication of the position of these things by creating a bounding box around them. Classification does not provide any information about the location of objects in the scene. Combining these two methodological pillars makes up segmentation techniques.

The segmentation enables a more accurate localization of the objects on an image as compared to the detection. The next step is to predict the class that corresponds to each pixel in the image. There are many deep learning architectures for segmentation, including Recurrent Neural Networks (RNNs), Encoders-Decoders, and Generative Adversarial Networks (GANs). However, the majority of them are based on Convolutional Neural Networks (CNNs), particularly Regional Convolutional Neural Networks (R-CNNs) and its extensions (Mask R-CNN, PANet, and MaskLab) [START_REF] Litjens | A survey on deep learning in medical image analysis[END_REF][START_REF] Garcia-Garcia | A survey on deep learning techniques for image and video semantic segmentation[END_REF]. The important aim of these R-CNNs is instantial segmentation, which they do by first applying a Region of Interest (RoI) algorithm to detect objects and then segmenting these RoIs. However, big databases, which are difficult to obtain for medical studies, are needed to train these algorithms. Contrarily, a fully-convolutional neural network (F-CNN)based architecture known as U-Net has demonstrated excellent performance on relatively small databases and is frequently used in research related to medical imaging [START_REF] Ronneberger | U-Net: Convolutional Networks for Biomedical Image Segmentation[END_REF][START_REF] Chen | LLASN:Lung lobes segmentation using adversarial network[END_REF][START_REF] Ferreira | End-to-End Supervised Lung Lobe Segmentation[END_REF][START_REF] Gu | A 2D3D hybrid convolutional neural network for lung lobe autosegmentation on standard slice thickness computed tomography of patients receiving radiotherapy[END_REF][START_REF] Tang | Automatic Pulmonary Lobe Segmentation Using Deep Learning[END_REF].

Heart organs [START_REF] Akkus | Deep Learning for Brain MRI Segmentation: State of the Art and Future Directions[END_REF] and brain organs [START_REF] Vu | A Fully Convolutional Neural Network for Cardiac Segmentation in Short-Axis MRI[END_REF] have both undergone extensive segmentation work. Work on lung segmentation has been influenced by a number of competitions, including LUNA16 [START_REF] Arindra | Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: The LUNA16 challenge[END_REF] and Kaggle Data Science Bowl 2017. Initially, studies concentrated on the identification and segmentation of nodules [START_REF] Messay | Segmentation of pulmonary nodules in computed tomography using a regression neural network approach and its application to the Lung Image Database Consortium and Image Database Resource Initiative dataset[END_REF] and as the work progressed, segmentation was extended to the lungs and then to the lobes. The U-Net architecture is the most present neural network in the different papers, with notably its 3D form, the V-Net [START_REF] Tang | Automatic Pulmonary Lobe Segmentation Using Deep Learning[END_REF][START_REF] Imran | Automatic Segmentation of Pulmonary Lobes Using a Progressive Dense V-Network[END_REF][START_REF] Lee | Efficient 3D Fully Convolutional Networks for Pulmonary Lobe Segmentation in CT Images[END_REF]. We have also based our development of an algorithm for segmenting the lung lobes and part of the bronchial tree on the U-Net. The algorithm, which we have trained, provides accurate descriptions of the morphological structures of the lower respiratory system.

Model of the bronchial tree

To explain and analyse respiratory system-related phenomena, particularly for intra-bronchial activity, mathematical models and numerical simulations are frequently used. The majority of lung research in the literature use generic bronchial tree models that do not accurately represent the unique morphology of the individuals. For the bronchial tree, it is more complicated to obtain a segmentation on medical images. The accuracy of the medical images does not allow the entire structure to be highlighted. Examples include studying aerosol deposition [START_REF] Noël | Interplay Between Optimal Ventilation and Gas Transport in a Model of the Human Lung[END_REF][START_REF] Petersson | Gas exchange and ventilationperfusion relationships in the lung[END_REF], gas movement in relation to disease, and gas exchange with the blood using numerical models [START_REF] Stéphano | Wall shear stress distribution in a compliant airway tree[END_REF][START_REF] Mauroy | Interplay between Geometry and Flow Distribution in an Airway Tree[END_REF][START_REF] Wall Wa Comerford | Structured Tree Impedance Outflow Boundary Conditions for 3D Lung Simulations[END_REF].

The models of the respiratory system frequently used to illustrate the bronchial tree do not necessarily reflect the exact morphology of real patients. Using lung casts, the first morphometric measurements and generic model of the bronchial tree were obtained by Weibel et al. [START_REF] Weibel | Fractal geometry: a design principle for living organisms[END_REF][START_REF] Ewald | Morphometry of the Human Lung[END_REF] or Horsfield et al. [START_REF] Horsfield | Computer simulation of the geometry of the human bronchial tree[END_REF][START_REF] Horsfield | Diameter, length and branching ratios in the bronchial tree[END_REF][START_REF] Horsfield | Models of the human bronchial tree[END_REF][START_REF] Horsfield | Morphology of branching trees related to entropy[END_REF][START_REF] Horsfield | Morphology of the bronchial tree in man[END_REF].

Weibel et al. tree model, known as the Weibel's A-model, is a regular dichotomous tree with 23 generations of branches. Each bifurcation is defined by a mother branch and two resulting daughter branches, which are referred to as sister branches. A mother branch and a daughter branch define a (35°) angle, which is commonly referred to as the "branching angle." Weibel's A-model is simple because of the symmetry of the airway bifurcations, which makes the model tractable. It is the most commonly used [START_REF] Noël | Interplay Between Optimal Ventilation and Gas Transport in a Model of the Human Lung[END_REF][START_REF] Brunengo | Optimal efficiency of high-frequency chest wall oscillations and links with resistance and compliance in a model of the lung[END_REF][START_REF] Mauroy | An optimal bronchial tree may be dangerous[END_REF][START_REF] Noël | The origin of the allometric scaling of lung ventilation in mammals[END_REF]. This symmetric version reduces the time required to compute solutions to models using bronchial tree structures. Like Weibel et al., Horsfield and Cumming have also made morphometric measurements on bronchial tree casts, from which they have defined a model where the branches have an average asymmetry.

Later, as computing power increased, three-dimensional asymmetric branching models were created, such as those by Kitaoka et al. [START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF] or Tawhai's model [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF]. Kitaoka's model is based on Murray's law. This law says that a segment of a live organ's diameter and flow rate are related. This model illustrates a system of branching ducts based on two principles: (1) the volume of the area supplied by a branch determines the amount of air flow through that branch; and (2) the terminal branches of the tree are uniformly distributed throughout the organ. To create this bronchial tree model, Kitoaka et al. defined a deterministic algorithm following a set of rules. A model of the bronchial tree in an idealized chest cavity was successfully recreated using this model, which has the benefit of being totally deterministic. However, the model encounters certain challenges in accurately representing the morphometric data.

The morphometric model of the bronchial tree produced by Tawhai's algorithm is now the most accurate [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF][START_REF] Merryn | CT-based geometry analysis and finite element models of the human and ovine bronchial tree[END_REF]. Like the Kitaoka's algorithm, the Tawhai's algorithm is also a set of rules for the growth of the tree. The approach is based on a technique for segmenting a two-dimensional domain that includes a collection of points [START_REF] Wang | Bifurcating distributive system using Monte Carlo method[END_REF]. The method is expanded to 3D by Tawhai et al., who also modify the subdividing procedure to take lung morphologic constraints into account. The sequential subdivisions of the lung envelope produce consecutive subvolumes, from which the airway tree is formed. The adjustments guarantee that the produced tree complies with the morphometric data and fits well to complex morphologies.

The capabilities and resources of computers have greatly increased since these concepts were first suggested. We suggest a new approach that relies on reconstructions of morphological structures from the segmentation rather than points clouds. The work of Kitaoka et al. was used as an inspiration to generate branch geometries to optimize the airflow in the bifurcations.

Competitive apnea diving

Freediving is the oldest method of diving in the world, starting with the ancient Greeks who used it to collect food, pearls or corals, or during military campaigns. Even today, for more than 2000 years, in Japan (Ama) and Korea (Haenyeo), women still snorkel to collect the jewels of the sea [START_REF] Nukada | Historical development of the ama's diving activities[END_REF][START_REF] Lindholm | The physiology and pathophysiology of human breath-hold diving[END_REF][START_REF] Schagatay | Underwater working times in two groups of traditional apnea divers in Asia: The Ama and the Bajau[END_REF]. Some people, such as the Sama-Bajau, are known to be adapted to this form of diving, with a larger spleen size [START_REF] Schagatay | Underwater working times in two groups of traditional apnea divers in Asia: The Ama and the Bajau[END_REF], which as we will see later, plays an important role in freediving. These breath-hold divers can make several short dives (≈ 1 min) per day, at depths of between 5 and 20 m and separated by recovery intervals.

In recent decades, professional athletes have emerged, such as the Italian Enzo Maiorca who achieved 50 metre sea water (msw) in 1960 or the Frenchman Jacques Mayol who descended to 100 msw in 1983 and from whom the film "Le Grand Bleu" (Luc Besson, 1988) was inspired. Professional divers have continued to push the limits of the human body in order to set records, whether in terms of time, distance or depth, at every competition organized either by CMAS (Confédération Mondiale des Activités Subaquatiques) or by AIDA (Association Internationale pour le Développement de l'Apnée), who create a stable and safe set of rules and guidelines for competitions and record attempts. During these competitions, three main categories are present, static apnea, dynamic apnea and deep apnea, each of which includes several events.

For static apnea, the event takes place in a pool, the athlete is then placed in the water with the head immersed and must hold as long as possible with a single breath. For dynamic apnea, the tests also take place in a pool, and the athlete must, with or without fins, swim as far as possible in a single breath. Finally, for deep apnea, the different events take place in the sea, and the objective is to descend as deep as possible. The descent can be made with the help of a weighted ballast, or with fins or not. In competition, there are two main events, the first is the Constant Weight, which is the most practiced, the principle of which is to descend and ascend with the use of fins, with a constant weight and in one breath. The diver is not allowed to use the rope except when making the turn to ascend. Then there is the Free Immersion, which consists of descending and ascending a rope by the sole force of the athlete without the use of propulsion equipment. This is one of the most relaxing disciplines and is often performed during training to learn the methods of balancing.

A final freediving event, which is not present in competition but whose tests are recognized by the AIDA, is the No Limit. This is the deepest depth discipline and can be the most dangerous for athletes. The aim is to descend as deep as possible with the help of a ballast weight and to use, for example, a balloon for the ascent. The records for these disciplines are listed in the Table 1.1.

STA -Static Apnea

FIM -Free immersion

Men 126 m. Women 101 m.

NLT -No limit

Men 214 m. Women 160 m.

Factor of performance

In all categories of competitive freediving, it is important to be able to hold your breath as long as possible. And it is through static apnea that this ability is expressed in the purest possible way. To date, the male record is 10 minutes and 35 seconds and the female record is 9 minutes and 2 seconds. To achieve such results, athletes must be able to control their metabolism to slow it down as much as possible and have a high tolerance to certain effects during their performance. There are three factors that determine their performance: total gas storage capacity, asphyxiation tolerance and metabolic rate. However, there are other factors that allow to go beyond the limits of understanding, which can be seen in the Figure 1.7. Thus, in addition to gas storage capacity, resistance to hypoxia (low blood O 2 concentration) and hypercapnia (high blood CO 2 concentration), and metabolic rate, during the dynamic version of apnea, a breath-hold diver must have perfect control of his effort in order to limit his consumption of oxygen, but also his production of lactic acid. Moreover, the storage of lactic acid is also an important and limiting factor for performance in dynamic apnea.

Total gas storage capacity

One of the important factors in making an apnea last is the total gas storage capacity. The human body must be able to store as much oxygen as possible, but also as much carbon dioxide as is generated by the muscles, even at rest. One of the first determining factors for the storage of gases is quite obvious, it is indeed a question of having an important pulmonary capacity so that the duration of the apnea is increased. According to a study by Schagatay [START_REF] Schagatay | Predicting performance in competitive apnoea diving. Part I: Static apnoea[END_REF], apnea athletes have a vital capacity well above the average with, according to measurements made on 14 professional athletes, an average of 7.3 L, which is 2L more than a group of people who do not practice apnea. However, this increased lung capacity is the result of many hours of training to increase chest flexibility, lung compliance and lung muscle strength. In the same article, the author believes that this increased lung capacity is largely due to training which then allows for an increase in chest flexibility, lung compliance and thoracic muscle power. This assumption has been confirmed by various studies [START_REF] Carey | Effect of Skin Diving on Lung Volumes[END_REF][START_REF] Gaultier | Effects of nutrition, growth hormone disturbances, training, altitude and sleep on lung volumes[END_REF] that have shown an increase in lung volume by doing dive training, swimming or staying at high altitude.

In addition to this exceptional physical condition, professional breath-hold divers have developed a breathing technique that allows them to store even more air. This technique, called "lung packing" or "glossopharyngeal breathing manoeuvres" [START_REF] Whittaker | Going to extremes of lung volume[END_REF], allows them, by using the oral cavity and tongue as a pump, to push small volumes of extra air down into the lungs which are completely full at TLC. Such a method can increase lung volume by up to 4L, and this increased air capacity not only provides more oxygen but also dilutes the carbon dioxide in the blood. This allows for a significant extension of apnea duration, but it is not without risk. Indeed, with this additional air supply, the intra-thoracic pressure will increase, resulting in a reduction of the venous return which can cause syncope if the apnea is too long. Syncope can also occur during a diving apnea and can occur both during descent and ascent. During descent, the lungs are compressed due to the increase in hydrostatic pressure (Boyle's law). The partial pressure of oxygen in the lungs also increases (Dalton's law) which means that more oxygen is transferred to the blood (Henry's law). Thus, during ascent a large amount of oxygen has been consumed and decompression of the lungs implies that the partial pressure of oxygen in the lungs is lower than that of the blood and causes a transfer of oxygen from the blood to the lung. Thus, the brain is less oxygenated.

Another key factor in the lung capacity of gases is the volume of blood and more specifically hemoglobin. To increase blood volume, athletes will train in high heat or perform endurance training to increase their plasma volume and therefore their blood volume [START_REF] Bass | Mechanisms of acclimatization to heat in man[END_REF][START_REF] Convertino | Exercise training-induced hypervolemia: role of plasma albumin, renin, and vasopressin[END_REF]. However, this increase has only a small impact on the gas storage capacity, for this to be really effective, the increase in blood volume must be accompanied by an increase in the volume of red blood cells. The latter contain hemoglobin, an iron-rich protein that is involved in the transport of oxygen and the extraction of carbon dioxide from organs and tissues. Thus, the higher the hemoglobin concentration, the more oxygen or carbon dioxide buffer the body is able to store (Haldane effect).

To do this, our body is naturally equipped with an organ that stores red blood cells, the spleen. During an apnea and under the effect of hypoxia [START_REF] Richardson | Hypoxia augments apneainduced increase in hemoglobin concentration and hematocrit[END_REF], the spleen will contract in order to deliver more red blood cells to the bloodstream. This release of red blood cells temporarily increases gas storage [START_REF] Qvist | Hemoglobin concentrations and blood gas tensions of free-diving Weddell seals[END_REF][START_REF] Hurford | Splenic contraction, catecholamine release, and blood volume redistribution during diving in the Weddell seal[END_REF]. The best apnea performances can be correlated with large spleen volumes, which allow apnea durations to be increased by about thirty seconds. This mechanism is an active contractile process, and it has been shown that it can be improved by training [START_REF] Richardson | Increase of hemoglobin concentration after maximal apneas in divers, skiers, and untrained humans[END_REF] and in particular by repeating apneas [START_REF] Schagatay | Speed of spleen volume changes evoked by serial apneas[END_REF]. In addition to this increase in splenic contraction, long-term training allows for an increase in erythropoietin (EPO) which controls the amount of red blood cells [START_REF] Eckardt | Rate of erythropoietin formation in humans in response to acute hypobaric hypoxia[END_REF][START_REF] Robert De Bruijn | Increased erythropoietin concentration after repeated apneas in humans[END_REF]. This increase in EPO then leads to a greater production of red blood cells and therefore a greater storage of gas.

Finally, the tissues play a major role in the storage of gases, and more particularly in the storage of carbon dioxide. The latter is mainly contained in the muscle tissue, which can store up to 10L [START_REF] Linér | Tissue oxygen and carbon dioxide stores and breathhold diving in humans[END_REF] of it for about thirty minutes continuously. In addition, muscle myoglobin will also allow, to a lesser extent, the storage of a little oxygen with approximately 2% to 3% of the total storage.

Metabolic rate

During apnea, it is important for a breath-hold athlete to have a low metabolic rate in order to prolong the duration of the apnea as much as possible. In order to lower the body's required energy consumption, various mechanisms come into play, some of which are inherent to the aquatic environment and others which are based on the athlete's lifestyle.

During static apnea, the head and body are immersed and this causes a metabolic response called the diving response [START_REF] Elsner | Diving and asphyxia. A comparative study of animals and man[END_REF][START_REF] Irving | Bradycardia in human divers[END_REF]. This mechanism is an important element in the reduction of metabolism as it both reduces the heart rate (known as bradycardia), and cause vasoconstriction in the areas most able to withstand a lack of oxygen [START_REF] Elsner | Diving and asphyxia. A comparative study of animals and man[END_REF][START_REF] Jung | Behavior of heart rate and incidence of arrhythmia in swimming and diving[END_REF] to redistribute blood to the heart and brain. This diving response then reduces oxygen depletion in the lungs. Bradycardia results

CHAPTER 1. INTRODUCTION

-2:00 -1:30 -1:00 -0:30 0:00 0:30 1:00 1:30 2:00 2:30 3:00 3:30 +0:30+1:00+1:30 0 100 200 300 400 Apnea (3min 30s)

Time [min]

Spleen Volume [ml] Figure 1.8: Progressive development of spleen contraction in a subject performing an apnea at rest. Taken from [START_REF] Schagatay | Predicting performance in competitive apnoea diving. Part I: Static apnoea[END_REF] in a decrease of up to 50% of the pre-performance heart rate [START_REF] Schagatay | Diving response and apneic time in humans[END_REF], which reduces the demand for oxygen by the cardiac muscles [START_REF] Lin | Breath-hold diving in terrestrial mammals[END_REF], and this decrease in oxygen demand is also observed in the muscles where vasoconstriction occurs. This preventive response to hypoxia is certainly natural, but it can be intensified by training and in particular the repetition of apneas. During a diving apnea, with the depth increasing, another phenomenon is triggered. The redistribution of blood will also affect the pulmonary vasculature and compensate for the loss of volume caused by gas compression. As the depth increases, the blood supply increases to compensate for the loss of volume in the lungs. This prevents the lungs from collapsing under the effect of hydrostatic pressure.

In the same way of reducing the metabolism, athletes will then perform relaxation methods before competitions, such as yoga meditation. These methods have been shown to have a significant impact on performance, with a reduction in oxygen consumption of up to 32% [START_REF] Telles | Oxygen consumption and respiration following two yoga relaxation techniques[END_REF].

Buoyancy and work economy

As with dynamic freediving, freediving athletes have a critical need to perform as little work as possible. However, during a dive, energy consumption will be lowered because at a certain depth the buoyancy has no effect and the athlete enters a free-fall where he or she does not need to exert any effort. Schagatay defines four phases in deep diving :

1. A first phase called the "positive descent", where the diver works to overcome positive buoyancy.

2. A second phase called the "free-fall", where the diver will drop until he reaches his mark.

3. The third phase, "negative ascent", begins after the turn and the athlete will provide energy to counterbalance the pull of the depths.

4. The last phase called "positive ascent", where the diver allows the buoyancy to bring him to the surface.

During the first phase, the air is compressed during the descent, which increases the oxygen pressure. More oxygen is then transmitted to the blood and muscles, which then have enough energy for their effort. This is followed by the transition point of free-fall, where the effort is stopped and the heart rate drops (Cf. Figure 1.9), due to the intensification of the diving response, Thus, conserving as much oxygen as possible to supply the heart and brain. The third phase, which initiates the ascent, is a little more difficult for the athlete, as some oxygen has been consumed, and the muscles must then draw on anaerobic metabolism to provide the necessary effort to the point of flotation. Finally, during the last phase, the ascent is easier as the buoyancy helps the athlete reach the surface. Taken from [START_REF] Schagatay | Predicting performance in competitive apnea diving. Part III: Depth[END_REF] The breaking point of the buoyancy is not the same for every diver, it depends on a number of factors. Some will make sure they have a shallower transition, and therefore make a greater effort to ascend, while others will prefer to make that effort from the start and move that transition point lower. This transition depends on the body composition of the diver, i.e. the fat/clean body mass ratio, the volume of air inhaled and the wetsuit and weights used during the dive.

Depth

For breath-hold diver, lung-safe depths can be reached depending on the quantity of air inspired at the surface (TLC) in relation to the minimum volume of air remaining after a forced exhalation (RV). The TLC/RV ratio provides an estimate of the maximum ambient pressure supported by the lungs of breath-hold divers. They use two techniques to increase their TLC volume and reduce their RV volume. The first method is "lung packing", which we have already discussed in the section on static apnea and which allows to store a larger quantity of air up to 4L more. The second method, "reverse packing", is applied during training to reduce the residual volume and to accustom the pulmonary part of the body to great pressure by simulating great depths. It consists, after a forced exhalation, in sucking the remaining air out of the lungs by stretching the chest and the diaphragm. In addition to reducing residual volume, this training is also effective in improving the flexibility of the diaphragm and rib cage. Thus, on average a normal person will have a total lung capacity of about 6L and a residual volume of 1.2L, whereas a breath-hold diver will have up to 8L of TLC and halve their residual volume. So, in theory, a normal person will be able to withstand a pressure of about 5 atm or 40 msw, a breath-hold diver will be able to go up to 16 atm or 150 msw.

Objectives of the thesis

We have just presented the complexity of the morphological structures and functioning of the respiratory system as well as the different factors involved in a sport where this respiratory system can be put to a severe test, apnea.

In this thesis, we wanted to address two issues. How to reconstruct a lung in a realistic, patient-specific way that can be integrated into numerical simulations ? Using numerical simulations, how can we model the effects of depth-related hydrostatic pressure on the lungs?

The chapter 2 present our segmentation tools, which allow the segmentation of the lobes of the lungs as well as part of the bronchial tree, in order to generate the first 3D models of these organs. As we have shown, the dichotomous airway tree is a very intricate part of the respiratory system to represent and is embedded in the lung geometry. The complexity of understanding its structure is also due to the fact that the study of the lung on real subjects is complicated, the first works were done in vitro [START_REF] Ewald | Morphometry of the Human Lung[END_REF]. However, with the progress made in medical imaging, it became possible to observe the structure of the lung in vivo, starting with X-rays, Thus, obtaining a 2D representation of the lung. The advent of CT-Scan then brought forward its three-dimensional visualization and increased the precision of the images allowing the use of image processing methods to generate the first segmentations of the lung. In recent years, the numerous Deep Learning tools have made it possible to obtain even more precise segmentations, to the point of being able to delimit the lobar volumes of the lungs, which correspond to sub-envelopes of the lungs, each containing a part of the bronchial tree. Our model is based on the use of a U-Net architecture and medical images made available in the framework of the digital challenge for the segmentation of pulmonary nodules (LUNA16 [START_REF] Arindra | Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: The LUNA16 challenge[END_REF]). We will compare our model with those already presented in the literature, which may reveal application problems due to their greed in computing resources.

In chapter 3, we will present a tool that allows us to generate an asymmetric bronchial tree from the segmentations obtained, taking into account the structure of the lobes of the lungs and going as far as the sub-acinus of the bronchial tree. There are already mathematical models to study the mechanisms of gas transport in the bronchial tree, but many of these models use a structure that is not fully representative of the bronchial tree. For example, the studies use symmetrical structures, or asymmetrical structures with few generations. These models give a first idea of the behavior of the system, and with the material resources we now have, it is possible to go further in the use of the asymmetrical models. Nevertheless, there are two tools, often used, available to generate a 3D model of the bronchial tree and these algorithms were developed at the beginning of the second millennium. Each of these models has a different ideology, and we have tried to update them, as these models are quite old, and to combine the principles of both in order to retain only the benefits of these two versions. We have also defined new calculation methods to speed up and make the developed model even more accurate and realistic. To demonstrate the effectiveness of our model, we analysed and compared it with the results of the two reference models and morphometric data obtained on real bronchial tree.

Chapter 4 will explore numerically the world of the abyss, the risks incurred and the adaptation of the human body to depth conditions. As we have shown, the lung/bronchial tree pairing is vital to the human body to such an extent that, under extreme conditions, our bodies do everything possible to preserve the lungs from potentially irreversible damage. By using numerical simulation models combined with our morphological representations of lung structures, it is then possible to explore the effects and potential risks to the lungs of these unusual conditions. This is particularly the case in deep apnea where the athlete dives to great depths (> 100 m) without breathing. The body is then subjected to high pressure, and the lungs, containing gases, are exposed to significant risks, even death. The body is then subjected to high pressures and the lungs, containing gases, are exposed to significant, even fatal, risks. We have developed a mathematical model representing the compression of the lung under a significant increase in hydrostatic pressure and will present our results, which will also provide a better approximation of the effect of blood shift on lung volume conservation in breath-hold divers.

Chapter 2

Introduction

Medical imaging is an important and broad field. It is an important aid for doctors in diagnosing injuries and diseases. The radiology is the most important speciality of medical 29 imaging and includes different types of examinations, such as X-ray images, CT scans, MRIs and ultrasound scans. These methods are often used for diagnostic purposes, as they have the advantage of being non-invasive. This means that these examinations do not require an invasion of the patient's skin, like biopsies. The repetition of some of these non-invasive methods, such as CT scans or X-ray images, can be dangerous, as they are subject to radioactive elements (in small quantities). We have worked, and their analysis, the methods found in medical imaging competition data, like LUNA16 [START_REF] Arindra | Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: The LUNA16 challenge[END_REF]. This method gives an accurate three-dimensional representation of internal organs. Analysis of the obtained images can be very challenging or time-consuming. The amount of information can be quantitatively very large and requires great concentration and precision from the operator. This is why the automatic or quasi-automatic analysis of medical images is a very important research topic. The first methods appeared in the early 1970s with methods for detecting lines and edges, or the use of mathematical structures to build systems for specific task. Later the algorithms were improved with the contribution of supervised techniques such as active shape algorithms, statistical classifiers, etc [START_REF] Litjens | A survey on deep learning in medical image analysis[END_REF]. More recently, especially in the last decade, deep learning algorithms with convolutional neural networks have taken precedence over other algorithms for image classification, organ detection, registration and segmentation [START_REF] Garcia-Garcia | A survey on deep learning techniques for image and video semantic segmentation[END_REF][START_REF] Litjens | A survey on deep learning in medical image analysis[END_REF][START_REF] Akkus | Deep Learning for Brain MRI Segmentation: State of the Art and Future Directions[END_REF].

Segmentation

In computer science, an image is a collection of information that can be observed. Human beings, by nature, are able to analyse and understand many information contained in an image more or less easily. For a machine, analyse an image is more difficult. Processing image to extract information is an important challenge in digital imaging and has many applications in medicine, science, security, industry, etc. For example, pattern recognition, object detection, image classification or, as the title of this chapter indicates, image segmentation can be performed. Segmentation, in image processing, is the mechanism of grouping pixels together, identifying the class associated with each pixel of the image, according to a criterion like a threshold value. A class corresponds to an element that we wish to identify in an image, it can be an object, an organ or a colour for example. This type of method allows forming sets of pixels that can be associated with objects or regions of the image [START_REF] Garcia-Garcia | A survey on deep learning techniques for image and video semantic segmentation[END_REF]. This process facilitates the analysis of the image thanks to a simplified or modified representation. However, this is a complex task and there is no universal method. Moreover, poor segmentation can have the opposite effect, making the image more complicated to analyse.

There are five different type of segmentation algorithms : the thresholding-based segmentation, the boundary-based segmentation, the region-based segmentation, the hybrid-based segmentation, and the deep-learning based segmentation [START_REF] Waseem | A survey: Image segmentation techniques[END_REF][START_REF] Zaitoun | Survey on Image Segmentation Techniques[END_REF][START_REF] Dzung | A survey of current methods in medical image segmentation[END_REF]. Threshold-based segmentations are a simple and is based on defining one or several thresholds for pixel values to extract pixel groups. Boundary-based segmentation methods aim to detect edges, i.e. one pixel wide regions at which the pixel values change abruptly or show discontinuities. Region-based segmentation methods detect similarities (value, colour) between adjacent pixels and group them into regions. Hybrid methods will use both boundary-based segmentation and regionbased segmentation. Finally, segmentations based on Deep Learning methods use convolutional neural networks trained on databases.

Thresholding-based segmentation

On the whole, the threshold value methods are quite simple and effective to implement. The principle being to separate a particular piece of information from the rest of the image. When using a single threshold value, one will then search for all pixels that are either above or below that value. We can also define an interval as a threshold to capture only the values within that interval. In the medical field, this approach is often used because medical images can have a wide range of data, such as CT scans which have values between -1000 and 1000 where each value corresponds to a type of material (air, blood, muscle, etc) [START_REF] Denotter | Hounsfield Unit[END_REF]. To define these threshold values, existing algorithms (Otsu, Optimal Threshold, etc) will then analyse the histogram of the image to extract consistent threshold values [START_REF] Bhargavi | A survey on threshold based segmentation technique in image processing[END_REF]. However, these methods do not take into account the spatial data of the image, which can lead to discontinuous segmentations and artefacts in the segmentation if the image contains noise.

Boundary-based segmentation

The principle of boundary-based segmentation consists of separating the different elements of an image by detecting the boundaries between these elements, such as edges. These methods often use the gradient or the Laplacian of an image to detect discontinuities in an image and thus to locate edges [START_REF] Dinesh | Medical image segmentation: a review[END_REF]. However, these methods can sometimes be inefficient, if an image has a lot of noise or little contrast, then the detection of edges will be more difficult. These methods may also have difficulty in linking edges and disjointed edges which do not lead to a proper segmentation of the elements of the image.

Region-based segmentation

Region-based segmentation algorithms aim at grouping neighbouring pixels according to similarity criteria, such as pixel values, shape or textures.

For example, a region growing method can be used. This method consists of selecting one or more pixels and the algorithm compares their values with its neighbourhood values and add the similar pixels to the selection. It repeats this operation with the new pixels until there are no more pixels to add [START_REF] Zaitoun | Survey on Image Segmentation Techniques[END_REF][START_REF] Dinesh | Medical image segmentation: a review[END_REF]. However, this method is computationally costly, especially on large images. Clustering methods are also often used, they allow to arrange the image in groups of same similarity like the color [START_REF] Zaitoun | Survey on Image Segmentation Techniques[END_REF][START_REF] Dinesh | Medical image segmentation: a review[END_REF][START_REF] Dzung | A survey of current methods in medical image segmentation[END_REF].

The K-means method is a region based method, and allows to classify the image in K groups of pixels, with the same properties (value, color, texture) and is used in particular in medicine. This method is faster than the region growing method but like many image processing algorithms, it is very sensitive to noise. The number of clusters, defined by a user, can be a source of error if it is badly defined.

Deep Learning segmentation

Finally, algorithms based on reinforced learning have been increasingly present in recent years, and have lead to very good results. The basis of segmentation algorithms via deep learning is based on two principles, classification and detection. Image classification aims to determine one or more classes associated with an entire image, and thus to make it possible to know that this image is the visual representation of one or more objects. However, classification does not provide information on the location of objects in the scene, whereas object detection algorithms provide a first approach to the position of these objects by generating a bounding box around them. Segmentation methods are a combination of these two methodical bases. We can distinguish two types of segmentation via Deep Learning method, semantic segmentation and instance segmentation [START_REF] Garcia-Garcia | A survey on deep learning techniques for image and video semantic segmentation[END_REF]. Semantic segmentation associates a class to each pixel of the image, so that images with several elements of the same class will not be distinguished. Semantic segmentation will not really make a difference between the objects, if there are three dogs then they will be returned as a single instance. Instance segmentation detect the different elements associated with a class and then segment these elements independently in order to distinguish them better. With the example of the dogs, the instance segmentation will return the three dogs as three distinct instances. Compare to the detection, the semantic segmentation then allows to have a more precise localization of the objects on an image. Its goal is then to make a prediction of the class associated with each pixel of the image. The modelling of this labelling problem amounts to assigning to each random variable X = {x 1 , ..., x N } a label of the space L = {l 1 , .., l k }, where each l i corresponds to one of the k possible classes or even k + 1 classes given that the background is considered as the class of label 0 and X corresponds to an image containing W × H = N pixels represented by the variables x. There are many deep learning architectures to solve this problem based on different networks, Recurrent Neural Networks (RNNs), Encoders-Decoders, Generative Adversarial Networks (GANs) but most of them are based on Convolutional Neural Networks (CNNs) such as Regional Convolutional Neural Networks (R-CNN) and its extensions (Mask R-CNN, PANet, MaskLab) [START_REF] Litjens | A survey on deep learning in medical image analysis[END_REF][START_REF] Garcia-Garcia | A survey on deep learning techniques for image and video semantic segmentation[END_REF]. These R-CNNs are mainly qualified for instantial segmentation and first apply a Region of Interest (RoI) algorithm to detect objects and then perform a segmentation on these RoIs. However, to be trained, these algorithms require a large database, which is not common in medical image studies. In contrast, an architecture based on a fully-convolutional neural network (F-CNN) called U-Net, has performed very well on relatively small databases and is often used in research associated with medical imaging [START_REF] Ronneberger | U-Net: Convolutional Networks for Biomedical Image Segmentation[END_REF][START_REF] Chen | LLASN:Lung lobes segmentation using adversarial network[END_REF][START_REF] Ferreira | End-to-End Supervised Lung Lobe Segmentation[END_REF][START_REF] Gu | A 2D3D hybrid convolutional neural network for lung lobe autosegmentation on standard slice thickness computed tomography of patients receiving radiotherapy[END_REF][START_REF] Tang | Automatic Pulmonary Lobe Segmentation Using Deep Learning[END_REF].

Base of the pulmonary lobes segmentation

Segmentation is very often used in medical imaging and has become an important tool in Computer Assisted Diagnosis (CAD) systems over time to help, for example, in the detection and monitoring of lung diseases, such as pulmonary nodules [START_REF] Messay | Segmentation of pulmonary nodules in computed tomography using a regression neural network approach and its application to the Lung Image Database Consortium and Image Database Resource Initiative dataset[END_REF]. Furthermore, with the advancement of computer technology, the number of research studies that rely on numerical simulation methods to better understand the physiology of the human body is increasing. It is then essential to obtain precise descriptions of the morphological structures associated with [START_REF] Garcia-Garcia | A survey on deep learning techniques for image and video semantic segmentation[END_REF] an organ, so that the simulations and the results obtained are sufficiently precise and realistic. The medical domain is a perfect laboratory for experimenting with different segmentation algorithms [START_REF] Litjens | A survey on deep learning in medical image analysis[END_REF]. A lot of work has been done on segmentation of brain organs [START_REF] Akkus | Deep Learning for Brain MRI Segmentation: State of the Art and Future Directions[END_REF], and heart organs [START_REF] Vu | A Fully Convolutional Neural Network for Cardiac Segmentation in Short-Axis MRI[END_REF]. The impetus of various challenges, such as LUNA16 [START_REF] Arindra | Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: The LUNA16 challenge[END_REF] or Kaggle Data Science Bowl 2017, have helped to influence work on lung segmentation, and initially, studies focused on the detection and segmentation of nodules [START_REF] Messay | Segmentation of pulmonary nodules in computed tomography using a regression neural network approach and its application to the Lung Image Database Consortium and Image Database Resource Initiative dataset[END_REF].

Subsequently, the first methods were devoted to the segmentation of morphological structures of the lungs, using thresholding and/or region-based methods. The combination of these methods comes from the fact that the lung is an air-like region contained in higher density structures. This involves finding a threshold value using the histogram of the image to obtain a first region of the lungs, which can be improved using a region growing method. These tools are globally simple to implement, fast and efficient, but some post-processing may be needed to refine the segmentation or correct some errors. In the context of the lung lobes, this work can be complicated due to their spatial proximity and value. One of the tools that can be used is the detection of fissures. A fissure correspond to a thin border delimiting the lobes. It was the basis of the first segmenting methods [START_REF] Doel | Review of automatic pulmonary lobe segmentation methods from CT[END_REF]. Most of these methods analyse the image to extract the largest planar structures, which correspond to the fissures. However, the results obtained may not be complete, as in some cases the representation of fissures on CT-Scans is discontinuous. This inconsistency can be the result of the patient's breathing during image capture. As for the lung segmentation some algorithms have been implemented to correct these potential artefacts. Finally, one of the last operations to improve the detection of fissures and therefore the segmentation of the lung lobes is the use of the anatomy of the lung tree and the network of pulmonary capillaries [START_REF] Doel | Review of automatic pulmonary lobe segmentation methods from CT[END_REF]. These two structures are intimately linked and have the particularity of not crossing the fissures. Thus, by working on a segmentation of these two trees, it is then possible to have a better approximation of the morphological structure of the lobes and the location of the fissures by detecting the gaps between airway and vessel trees. The combination of these methods can be a lengthy process whose results are not necessarily guaranteed [START_REF] Doel | Review of automatic pulmonary lobe segmentation methods from CT[END_REF].

In recent years, other methods, notably based on Deep Learning methods, have emerged. Initially, studies focused on the detection and segmentation of nodules [START_REF] Messay | Segmentation of pulmonary nodules in computed tomography using a regression neural network approach and its application to the Lung Image Database Consortium and Image Database Resource Initiative dataset[END_REF] and as the work progressed, segmentation was extended to the lungs and then to the lobes. In particular, an architecture presented by Ronneberger et al., has stood out and is very often used for 2D medical image segmentation, this architecture is a fully-convolutional neural network (F-CNN) called U-Net. This architecture has the advantage of being efficient with a limited number of images, unlike other Deep Learning methods which require a large database. And in the medical environment, obtaining a large database can be difficult.

However, it is becoming easier to obtain medical images thanks to competitions that are organised to promote the development of computer-aided diagnosis (CAD) tools. Thus, the U-Net has evolved into an architecture adapted to three-dimensional images, called V-Net. Algorithms based on this architecture [START_REF] Tang | Automatic Pulmonary Lobe Segmentation Using Deep Learning[END_REF][START_REF] Imran | Automatic Segmentation of Pulmonary Lobes Using a Progressive Dense V-Network[END_REF][START_REF] Lee | Efficient 3D Fully Convolutional Networks for Pulmonary Lobe Segmentation in CT Images[END_REF] have shown good results, but have a hardware limitation. To train this type of algorithm, it is necessary to have important computing resources and notably powerful GPUs with a large amount of RAM. To avoid this limiting factor, we devoted our work to the creation of a 2.5D algorithm, which makes it possible to exploit the 3D images at best while keeping the hardware ressorces low by working on 2D data.

This algorithm also uses the U-Net architecture, but with the particularity of being able to perform a segmentation in the three axes of a CT-Scan (axial, coronal and sagittal) and then to use the information obtained by these three segmentations to generate a single segmentation. The resulting segmentation then contains information on the position of the lobes and the bronchial tree. This first segmentation is then refined by using anatomical properties, such as the position of the different trees, to improve the predictions of the localization of the fissure.

Patient data

As the algorithm developed is patient-specific, it is important to have a data set on which to extract morphological structures in order to test the algorithm. The data used are obtained from CT-Scans. CT-Scans provide fairly accurate representations of the human body and are frequently used for diagnostic purposes. This method is quite similar to X-ray imaging. Small amounts of x-rays are projected through the body and absorbed to a greater or lesser extent by the tissue. Receptors, placed in front of the x-ray tube, measure this absorption and, with the help of a computer process, reconstruct a transverse image. This process is then repeated on several levels, hence the use of the term tomographic, to obtain a three-dimensional image composed of voxels defined by a size and a value. This value corresponds to the quantitative measure of radiodensity, whose value is contained in the interval [-1000, 1000] and its unit is the Hounsfield Unit [START_REF] Denotter | Hounsfield Unit[END_REF], named after Sir Godfrey Hounsfield, one of the architects of the CT-Scan method. However, this method can be harmful to the body if it is repeated too often, which makes it more complicated to perform for a study, and for healthy patients.

Nevertheless, two consortia, the Lung Image Database Consortium (LIDC) and the Image Database Resource Initiative (IDRI), have set up a large database called the LIDC-IDRI [START_REF] Armato | The Lung Image Database Consortium (LIDC) and Image Database Resource Initiative (IDRI): A completed reference database of lung nodules on CT scans[END_REF], bringing together several thoracic CT scan data. This library includes more than a thousand patient data sets, diagnosed with lung cancer, and has been used many times for Deep Learning / AI challenges, like LUNA16 [START_REF] Arindra | Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: The LUNA16 challenge[END_REF]. This is raw data were the lobes and bronchial tree have not been annotated, which constrains their use in the training of deep learning algorithms. However, for training purposes we were able to use 50 patient data from the LIDC-IDRI library. This data were used for the LUNA16 challenge and annotations have been made public thanks to the work of Tang et al. [START_REF] Tang | Automatic Pulmonary Lobe Segmentation Using Deep Learning[END_REF]. The annotations have been done in collaboration with radiologists.

Method

In this section we will discuss the work that has been done to develop our 2.5D algorithm of lung lobe segmentation. We will discuss our data preparation, the first binary segmentation algorithm we defined, and its evolution into the lung lobe and bronchial tree segmentation. We will explain the choices made on the architecture, its components and the training parameters.

Binary segmentation

The first segmentation algorithm was largely based on the U-Net, and as with the first segmentation algorithms, the trainings were geared towards segmenting the lungs only, without differentiating between right and left. This allowed first to better understand the implementation, the requirements and the parameters of the U-Net architecture and of his implementation.

Pre-processing

First, it is important to prepare the database for training. Very often segmentation algorithms based on Deep Learning use greyscale or RGB images in PNG or JPG format. These are images composed of one or three matrices whose pixel values range is between [0 and 255]. There was then a conversion work that was required to pass from a CT-Scan image to a greyscale image. For that we just apply a linear function to change the range of values from [-1000, 1000] to [0, 255] and save them as PNG. In this first version, we managed to work only on the axial plane, to facilitate this pre-processing. We made this choice because to train the algorithm the images provided must all be of the same size. In the axial plane, the images are all the same size from one patient to another, with a size of 512x512. In the other two planes, the size of the images will depend on the number of slices made for each patient, which is not necessarily the same. In a second time, we've managed to avoid using the PNG or JPG images and work directly with the raw data from the CT-Scan and then keep the original data range.

For the annotations, these are also images that will contain the label associated with each class that we wish to segment. A label is simply an integer that is assigned to define a class. In the annotations of Tang et al. [START_REF] Tang | Automatic Pulmonary Lobe Segmentation Using Deep Learning[END_REF], we can find several labels associated with the different lobes or the bronchial tree. By convention the label 0 is associated with the background and, in the binary case, we have defined the label 1 for the different lobes in order to group them as the lung.

In the following, we will often speak of ground-truth, which is the binary annotation we have just defined. Each axial section of a patient has a ground-truth. This will allow the algorithm to evaluate whether it is close to the desired results or not.

Architecture

As explained in the introduction, there is a particularly effective architecture for medical data. This architecture is a fully revolutionary neural network (F-CNN) called U-Net, and was developed by Ronnebergeret al. [START_REF] Ronneberger | U-Net: Convolutional Networks for Biomedical Image Segmentation[END_REF]. This convolutional neural network is divided into two parts, one contracting and the other expanding as can be seen in Fig. 2.3 which represents the original version of the U-Net architecture. The first part, which can also be called topdown, allows to highlight the important numerical information at the expense of the spatial information. This part consists of repeating a compound block several times in the order of the following five elements:

1. A 3 × 3 convolution layer (Conv 3 × 3).

A rectified linear unit layer (ReLU).

3. A 3 × 3 convolution layer (Conv 3 × 3).

A rectified linear unit layer (ReLU).

A 2 × 2 max pooling with stride 2 layer (Max Pool).

A convolution layer is the application of several filters of defined size, here 3 × 3 to the input data. The output is the result of convolving each input with each filter. The parameters of these filters are the parameters to be set during a training session. At each stage of the training their values are corrected and optimised according to the results obtained in the previous stage.

The different results obtained at the output of a convolution layer then pass through the activation layer. Here, this is a ReLU activation function whose defined by max(0, x) where x is a data of the matrices, as can be seen in Figure 2.5.

The 2 × 2 max pooling operation with stride 2 allows to reduce the size of our matrices by two, we speak about downsampling. For that, we will take the maximum value of a submatrix 2 × 2. The displacement step is two columns from right to left and two rows from top to bottom.

The number of convolution filters is doubled at each repetition of a block.

The second part, also known as bottom-up, allows this information to be placed in the image. As for the first part, it is the repetition of a block of elements, executed in order, with :

1. A 2 × 2 up-convolution layer (Up-Conv 2 × 2).

A concatenation with the feature map of the contracting part (Concat).

3. A 3 × 3 convolution layer (Conv 3 × 3).

A rectified linear unit layer (ReLU).

The first layer, Up-Conv 2 × 2, allows to upsample, i.e. to enlarge the size, the input of the block. To do this, a larger image is reconstructed using the input of the block. A padding of 1 is added to this image, i.e. each element of the input is surrounded by 1. Then we convolve the image with a 2 × 2 filter. The concatenation takes the output of the up-conv and combines it with the output of the same level block in the downstream part.

At the end of the different repetitions, a last convolutional layer of 1 × 1 combined with a softmax activation function, or normalized exponential function, is performed. The output is a probability matrix with the number of desired classes, here it's 1 namely because we've only got the pulmonary parts that need to be identified.

Loss Function

Deep Learning segmentation algorithms are based on the principle of mapping a set of inputs to a set of outputs from training data. For this purpose, as shown in the architecture part, we use different filters and activation functions, which correspond to a large number of parameters and weights whose values are not known at the beginning of the learning process. The learning process is in fact an optimisation problem where we go through the set of possible parameters to get a good approximation of the desired result. This is done using the stochastic gradient descent optimisation algorithm [START_REF] Goodfellow | Deep learning[END_REF], which will then update the parameters using the error back-propagation algorithm [START_REF] David E Rumelhart | Backpropagation: The basic theory[END_REF], so that the next iteration gives a better result. The backpropagation algorithm is a method of traversing the algorithm in reverse order of execution.

These errors are calculated using a loss function, which is an important metric used in machine learning and deep learning, to understand the effectiveness of the algorithm. It provides an assessment of the distance between the results obtained by the algorithm (prediction) and the desired result (ground truth), which will then be used by gradient descent to update the parameters.

This version of the segmentation is a binary segmentation then the typical loss function is the binary cross-entropy loss that is defined with :

H p = - 1 N N i=1 g i • log(p i ) + (1 -g i ) • log(1 -p i ) (2.1)
where g i is the label of the ground truth (0 if background, 1 if lung) of the i-th pixel and p i is the predicted probability of the i-th pixel to be part of the lung. N is the total number of pixel of the image to segment.

Throughout the training, the aim is then to make this function converge towards 0.

Implementation

There are different parameters for training the algorithm, such as the batch size for example, or the image reduction factor, define as the scale. These parameters are set before the training, and are called hyperparameters.

The first, the batch size, is one of the most important hyperparameters to set in modern deep learning systems. It corresponds to the number of training samples to be processed before the internal algorithm parameters are updated.

Another hyperparameter is the number of epochs you will do during a training session. An epoch is a learning cycle in which you will work on the entire learning data set.

A large batch size will technically lead to faster computation, but more epochs are needed to achieve convergence of the loss function 2.1. In addition, the batch size is also limited by the memory associated with the graphics card.

The other parameter that influences the training speed and the accuracy of the predictions is the scale, which corresponds to a reduction factor of the image size. The images used for training have a size of 512x512 and using a scale of 0.5 for example, the image will have a new size of 256x256. It allows for a shorter training time but a loss of information on the input, which will then have an influence on the prediction obtained [START_REF] Rukundo | Effects of Image Size on Deep Learning[END_REF].

For this first algorithm, we only work on the axial plane with 40 patients, which correspond to around 10000 slices. The training has been made with 150 epochs, a batch of 32 and a scale of 0.5.

2.5D Multi-class segmentation

After having been able to obtain a segmentation of the morphological structure of the lung, the second algorithm aims to generate a multi-class segmentation in order to extract the different lobes of the lung and part of the bronchial tree. For this purpose we set up a 2.5D algorithm, by applying a 2D segmentation on the different spatial axes of the algorithm and by using the information from these 3 axes to reconstruct a better segmentation.

Pre-processing

As with the binary version, we also used the raw CT-Scan data. As mentioned, this version segments CT-Scan slices along each axis (axial, coronal and sagittal). However, the matrix of a CT-Scan is generally a 3D matrix of size 512 × 512 × nb slices . We then have a series of nb slices of size 512 × 512 in the axial axis, but for the coronal and sagittal plane the size is 512 × nb slices . The difference in size can cause an error during the training. To avoid this, it is then important to interpolate the size of all the image of the sagittal and coronal in order to obtain a database composed only of images of size 512 × 512.

Architecture

We have made some modifications on the component of the U-Net architecture, by modifying the activation functions or by adding other functions in the convolution blocks. First, the ReLU activation functions have been replaced by Parametric Rectified Linear Units (PReLU), as it has been observed that in some cases the ReLU function is considered "dead" if it is stuck in the negative range and always outputs 0. As the slope of ReLU in the negative range is also 0, once a neuron goes negative, it is unlikely to recover. Such neurons play no role in input discrimination and are essentially useless. Over time, you can end up with a large part of your network doing nothing. The PReLU activation function allows you to rectify this problem of "dying ReLU", by allowing a slight slope when the values are negative instead of a zero slope, as can be seen in Figure 2.5. Prior to this new activation function, we also added a Batch Norm layer, whose purpose is to refocus and normalise the results obtained by the convolutions in order to make the algorithm more robust and faster to train.

Loss Function

Like many other multi-class segmentation algorithms [START_REF] Jadon | A survey of loss functions for semantic segmentation[END_REF][START_REF] Sudre | Generalised Dice Overlap as a Deep Learning Loss Function for Highly Unbalanced Segmentations[END_REF] we have, at first, used the Dice Loss, based on the Sørensen-Dice coefficient, and defined by :

D = 1 - 2 C c N i p i,c g i,c C c N i (p 2 i,c + g 2 i,c ) (2.2)
Where p i,c and g i , c respectively refer to the i-th pixel of the prediction and the ground truth for the c-th class, with value defined between 0 and 1. This loss function is widely used in medical image segmentation problems to solve the imbalance of the dataset. There are two kinds of imbalance : the imbalance of the class and the imbalance of the prediction. The imbalance of the class means that some classes are under-represented in the dataset. The imbalance of the prediction appears during the training. Some pixels will be correctly classified early on (easy-example) and others will be misclassified (hard-example) [START_REF] Kishida | Empirical Study of Easy and Hard Examples in CNN Training[END_REF]. Their contribution to the loss function can also lead to an imbalance. For example, pixels at the border are more difficult to classify correctly than pixels in the centre. Dice Loss only deals with this class imbalance problem.

Subsequently, we also tested the generalized version of this Dice Loss, the Tversky loss, in order to obtain a better compromise between Precision and Recall in the segmentation of highly unbalanced data. Precision and Recall are two performance metrics to evaluate the quality of our prediction with the ground-truth. This loss is defined as :

T = 1 - C c N i p i,c g i,c C c N i (p i,c g i,c + α(1 -g i,c )p i,c + β(1 -p i,c )g i,c ) (2.3)
Where p i,c and g i,c are, as for the Dice Loss, the prediction and the ground truth. α = 0.5 and β = 0.5 are coefficient applied to control the intensity of the penalties for the False Positives (p i,c = 1 and g i,c = 0) and the False Negatives (p i,c = 0 and g i,c = 1) (Cf Table 2.1). False positives are pixels in our prediction that belong to a class c when they do not belong to this class in the ground-truth. False negatives are the opposite, our prediction does not associate the pixel with class c when it should be. As the Tversky Loss is a generalization of the Dice Loss, we encountered the same problems of unequilibrium on complex areas.

We then examine another loss function that combines the Dice Loss with another loss function, the Focal Loss, as used in the article by Tang et al. [START_REF] Tang | Automatic Pulmonary Lobe Segmentation Using Deep Learning[END_REF]. The Focal Loss was introduced by Lin et al. [START_REF] Lin | Focal loss for dense object detection[END_REF] as a means of combatting imbalanced datasets [START_REF] Jadon | A survey of loss functions for semantic segmentation[END_REF], this will help the algorithm for the prediction of the border pixel, who are more difficult. The Focal Loss is based on the definition of the cross-entropy, whose function 2.1 was explained in the section on the binary version. Lin et al. introduced a γ factor to reduce the contribution of easy examples (down-weighted) to compensate the imbalance between easy and hard examples. And for the imbalance between the classes (with a more important presence for certain classes) the α-balanced version of cross entropy is used. The Focal Loss function is defined as:

F = - 1 N C c N i α c × (1 -p t ) γ × log(p t ) with p t = p i,c if g i,c = 1 1 -p i,c else (2.4)
α c is a weighting factor for the class c, and γ is used to adjust the down-weighting of the easy example. From Lin et al. [START_REF] Lin | Focal loss for dense object detection[END_REF], we have α = 1 and γ = 2.

The hybrid loss function with Dice/Focal Loss is then simply the sum of the Dice Loss and the Focal Loss.

HL = D + L (2.5)

Post-processing

The other major difference, in addition to the multi-classification, is the use of the three axes of the CT-Scan, motivated by the presence of additional information on the position of the cracks. For each patient, we make predictions on each slice of each axis, thus obtaining three matrices of size nb class × 512 × 512 × nb slice . Once these three matrices are obtained, we can calculate a weighted average for each pixel of each class as follows :

p i,j,k,l = 1 α × i+1 m=i-1 j+1 n=j-1 k+1 o=k-1 l+1 q=l-1 αp m,n,o,q , with α = 2 if m = i, n = j, o = k α = 1 otherwise.
(2.6) where, i, j, k are the spatial coordinate of a pixel in a matrix and l is the plane. This gives a single nb class × 512 × 512 × nb slice matrix to which an argmax, on the first dimension, is then applied to obtain a prediction. The argmax returns the class associated with the highest probability in the first dimension of the matrix.

2.5D multi-class segmentation with attention gates

This version of the segmentation algorithm is the final version. In this version, we have introduced a new convolutional block, called Attention Gates, in order to help the algorithm to better target the important areas. We will make a comparative study of the possible loss functions for this type of work. The pre-processing, post-processing and the training parameters, remain the same as for the binary segmentation version.

Architecture

In order to improve the segmentation, we have chosen to integrate attention gates block in the architecture [START_REF] Oktay | Attention u-net: Learning where to look for the pancreas[END_REF]. This allows the neural network to focus on the regions of the image that are of most interest, and thus limit potential resource wasting. In our case, the background (which on most of our CT-scans represents about 50-60% of the image) is not very interesting and contains very little information. Having our U-Net focus on the lungs and surrounding tissue would theoretically give better results for the same amount of training time.

There are two methods of attention: Hard Attention and Soft Attention [START_REF] Niu | A review on the attention mechanism of deep learning[END_REF][START_REF] Liu | Visual attention in deep learning: a review[END_REF][START_REF] Oktay | Attention u-net: Learning where to look for the pancreas[END_REF]. For our algorithm we have concentrated on Soft Attention, because it allows the use of backpropagation. Soft Attention consists of assigning weights to different parts of the image. The more relevant the image, the higher the weight. These weights are updated automatically as the neural network is trained, so it focuses more and more on the relevant areas of the image. We will then apply this method to the expansive part of the U-Net. The Attention Gates is placed just before each concatenation layer. The block takes two elements as input. The first is the output of the block at the same level of the descending part. The second is the output of the block at the level below the ascending part of the U-Net

The Attention Gate is a new block containing the following layers [START_REF] Oktay | Attention u-net: Learning where to look for the pancreas[END_REF] : 1. A ×1 convolution layer (Conv 1 × 1) apply on the input from the descending part.

2. A concatenation layer with the result of the Conv 1 × 1 and the input from the ascending part.

3. A ReLU activation layer with the output of the concatenation layer.

4. A ×1 convolution layer with the output of the ReLU.

5.

A Sigmoid activation layer with the output of the Conv 1 × 1.

6. A Resampler layer with the output of the Sigmoid. It is used to change the size of the output of the Sigmoid to match with the size of the input from the descending part.

7. A Multiplication layer with the input from the descending part and the output of the resampler.

Post-processing

In this version, in addition to the weighted average correction 2.6, we also performed another post-processing step. Small artefacts may occur during prediction. To reduce the number of artefacts, we defined an algorithm based on the connected components. The principle of component-connected makes it possible to generate groups of neighbouring pixels with similar properties. In our case, we proceed with a connected-component labelling method to identify the different connected regions with the same classe. These regions are then sorted by volume, and we keep the 6 most important ones which correspond to the different lobes of the lung and the bronchial tree. The other regions are analysed in order to try to rattach them to the other 6 regions. To do this, we are recovering these voxel zones and studying the classes of the neighbouring components. This allows to obtain only 6 large connected volumes and to erase the possible artefacts.

Metrics

As explained above, we trained several algorithms, using different structures (such as attention gates), or different components (such as the use of different loss functions). In order to evaluate the performance of these algorithms, we set up a series of tests to determine the areas of effectiveness of these algorithms as well as the areas to be improved, always with the aim of optimising the segmentation results. We only used the algorithms related to multi-class segmentation, the first three of which use the 1st version of multi-class segmentation, without the attention gates, and each uses a loss function mentioned above, the dice loss, the tversky loss and the dice/focal loss. The last algorithm uses the U-Net architecture combined with Attention Gates and Dice/Focal Loss. For each algorithm, we generated a segmentation in the axial, sagittal and coronal planes. We then applied post-processing using the weighted average to obtain a fourth segmentation. Finally, each of these four predictions was improved using the connected component labelling process.

Each of these segmentations was then compared with the ground-truth to obtain a confusion table which is a table comparing the algorithm predictions with the ground-truth. This table contains True Positive (TP), True Negative (TN), False Positive (FP) and False Negative (FN). The True Positive is the number of pixels where the prediction is positive, and the ground truth is actually positive. The True Negative, is the number of pixels where the prediction is negative, and the ground-truth is actually negative. The False Positive defines the number of pixels where the prediction is positive but the ground-truth is negative. Finally, the False Negative represents the number of pixels where the prediction is negative and the ground-truth is positive. From these 4 outcomes we were then able to calculate 5 metrics, the F1-Score, Precision, Recall, Specificity and Accuracy. As we are working on a multi-class segmentation, we calculated these metrics for each class of the segmentation as well as for groupings of classes such as the left lung or a binary segmentation of the respiratory system, which allows us to have information on the quality of our results both locally, with the values for each lobe, but also globally by grouping the whole segmentation. The firts metric, the Precision, is a ratio between the number of correctly labeled pixels and the total number of pixels associated with this class on our segmentation. This makes it possible to compare the correctly segmented pixels with the segmentation as a whole and thus know whether the latter is correctly defined. It is formulated as follows:

P recision = T P T P + F P (2.7)
The closer the Prediction value is to 1, the less segmentation error there is. However, this value does not fluctuate much if the number of predictions made is low, so in order to avoid the errors of Precision, we will introduce another metric. The Recall is a metric that calculates the ratio between the number of correctly segmented pixels and the total number of pixels associated with this class on the ground truth. We then have an estimate of the quality of our segmentation compared to the desired one. It is then formulated with :

Recall = T P T P + F N (2.8)
Recall is then related to quantity, i.e. the number of true labels found. Precision and Recall are measures to be exploited closely. If the Precision is good enough it does not necessarily mean that the segmentation is good, because if the Recall is not sufficiently good, it means that the segmentation has missed some information. Conversely, if Recall is good but Precision is not, then the segmentation obtained is too large. The F1-score allows the values of Precision and Recall to be summarised in a single metric. It gives information on the balance between the two metrics, from a mathematical point of view, it is the harmonic mean between Precision and Recall. This metric is also called the SørensenDice coefficient, and it provides an evaluation of the similarity between the segmentation obtained and the ground-truth, the formula used for the computation is defined as :

F 1 = 2 × T P 2 × T P + F P + F N = 2 × P recision × Recall P recision + Recall (2.9)
The value of the F1-Score varies between 0 and 1. When the F1-Score is close to 1 it means that the algorithm is performing well and that the prediction obtained contains few errors.

The ante-penultimate metric, Specificity, will help us to know how the algorithm behaves with false positives by providing an assessment of True Negatives in relation to the total negative pixels of the ground-truth. Its value is obtained by :

Specif icity = T N T N + F P (2.10)
Finally, Accuracy is the most intuitive metric. It is simply the ratio of the number of correct predictions to the total number of predictions. To compute it we used the following formula :

Accuracy = T P + F P T P + T N + F P + F N (2.11)
We can then assume that if the accuracy is high it means that the algorithm is performing well. However, this is only the case when the background and the items to be classified are of the same size, otherwise one or the other will have a greater influence on this value and will not really reflect the efficiency of the algorithm. This is why we have these five metrics at our disposal and why we are going to study the results obtained globally, in the next session.

Results

Benefit of the Weighted Average

In order to understand the advantages of our 2.5D method, we will show the benefits of using a weighted average of the three planes by observing the results of the metrics for the Attention Gates algorithm combined with the Dice/Focal Loss. The post-processing algorithm based on connected components is not applied in the results we study. The Table 2.2 then groups the different metrics measured during the tests, namely, Precision, Recall, F1-Score, Specificity and Accuracy. The table groups the values for each lobe and the average of all. However, in addition to the lung lobes, our algorithms also perform a segmentation of the respiratory branches, such as the trachea or the pulmonary branches. We then have a local score for each class, an average score for the different lobes and a global score for the segmentation of the lungs.

As we wish to use this table to demonstrate the effectiveness of the weighted average, we will concentrate our analysis on the first three metrics (Precision, Recall and F1-Score). There is no need to elaborate on the other two metrics (Specificity and Accuracy) as the results obtained are all above 99% and there is not much point in differentiating them. These two metrics are too influenced by pixels that do not belong to the same class. Looking at the table 2.2, it can be clearly seen that the use of the weighted average gives much better results compared to the segmentation obtained in the three axes of the CT-Scan. Let's take, first, the Precision for which we can see that in all the classes, the weighted average makes it possible to make less possible error. We can see that the weighted average allows a very important improvement compared to the results obtained on the CT-Scan axes. As far as the slice planes are concerned, it seems that the axial plane is the most precise in terms of the results obtained, with an average of 93.22% for the axial plane, 91.66% for the coronal plane and 88.40% for the sagittal plane over all lobes. The weighted average performed much better with a Precision of 95.08% for all lobes. In the right upper lobe, the weighted average is at least 3 points higher than the slice planes, with 96.60% of Precision for the weighted average when the axial plane is only at 93.70%. For the middle lobe, we notice that the algorithms have a high tendency to make errors with 75.40% Accuracy for the weighted average with more than 5% percent deviation from the axial plane which performs the best of the three planes. This lobe is the most difficult lobe to segment, as we will see in the discussion, other algorithms presented in the literature also have this segmentation problem. For the lower right lobe, the algorithms made far fewer errors than with the middle lobe with a minimum of 89.17% accuracy for the sagittal plane up to 93.96% for the weighted average. On the left side of the respiratory system, the algorithms seem to perform better. This gain in Precision comes from the fact that there are only two lobes to segment and the work is therefore easier. The weighted average Precision for the upper left lobe and the lower left lobe is 98.65% and 97.53% respectively, which is slightly better than the predictions obtained on the coronal plane. The latter obtained 98.10% and 97.30% for the upper and lower lobe respectively. The sagittal plane results were the least precise with 89.89% and 91.26% for the upper and lower left lung. The percentages are as high for the left lung as for the airways. The weighted average remains at the top of the rankings with 96.96% accuracy, where the other algorithms are more erroneous with 91.24%, 90.47% and 93.78% accuracy for the axial, coronal and sagittal planes respectively.

However, as we have explained, we should not only take into account the Precision, as this gives an idea of the number of errors made on the labelling, but it does not mean that we capture all the elements of a class. It is then necessary to observe the values measured for the Recall, which allow us to have more information on the quantity of correctly classified pixels compared to the ground-truth. As for Precision, the weighted average is the one with the best metric over all lobes with 95.61%. For the other cutting plane on the axial axis, the average results are very good with 94.85%, for the coronal plane, which does a little less well, we obtain 92.97% and finally the sagittal plane does not exceed 90%. On the right side of the respiratory system, it can be seen that, compared to Precision, the upper lobe seems to have poorer Recall results, while the other two lobes have better results. For example, the weighted average captures only 88.75% of the upper lobe and includes 98.39% of the lower lobe, and finally 90.19% of the middle lobe. This difference between Precision and Recall is due to the fact that more errors are made on the lower and especially the middle lobes, according to Precision. These errors are then reflected in the segmentation of the upper lobes which cannot classify the entire volume. For the other slice planes, the same phenomenon is observed, the axial plane being the one that seems to best encompass the volumes with respectively, 90.36%, 85.97% and 97.26% for the upper lobe, the middle lobe and the lower lobe. For the left lung, the results are as good as for the Accuracy, with at least 95% Recall for both lobes. Again, the weighted average captures most of the lobes with 98.05% for the upper lobe and 98.09% for the lower lobe, followed closely by the axial plane with 96.87% and 97.26%. The bronchial tree, or at least the first generations, are not very well segmented as a whole, as our algorithms only detect at most three quarters of the expected volume. The weighted average dominates with 76.39%, followed by the coronal plane with 75.13% Recall, then the axial plane with 74.81% and finally the sagittal plane comes at the end with 73.22% Recall.

In order to highlight the previous metrics and see which plane has the best balance between quality and quantity, we will now look at the F1-Score. It can be seen that the weighted average algorithm is the best compromise between Precision and Recall and achieves good segmentation of the different lobes with 92.51% on the right upper lobe, 82.14% on the right middle lobe, 96.13% on the right lower lobe, a minimum of 98% on the left side of the respiratory system, 85.46% for the Bronchial Tree and a global average of the lobes equal to 95.341%. Nevertheless, the axial plane also provides a good compromise between Precision and Recall. The difference between this plane and the other two is that the images in the axial plane have not been rescaled, they all have a size of 512 × 512 at the start. In the other axes, the image size depends on the number of slices made for each patient. This results in image size that vary from patient to patient. In order to have similar sizes, the images are rescaled, which can lead to a degradation of the image quality. And so the segmenting algorithms have more difficulty in fitting well, despite our readjustment of the sizes in the coronal and sagittal planes.

The Table 2.3 groups the predictions obtained in the different axes, as well as the weighted average. One can see on the predictions obtained, the observations made on the metric results. For example, the segmentation of the right middle lobe (green) is quite inaccurate and contains many errors. These errors spill over into a part of the right upper lobe segmentation (yellow). There is also a lack of classification for the bronchial tree. The latter is in purple on the figure, and one can notice that some parts classified in the ground-truth are not classified in the prediction, hence the rather average values for the Recall. When we compare the results of the average with the ground-truth, the results obtained with this algorithm provide a good approximation of the morphological structures of the respiratory system. Finally, the axial segmentation is quite accurate compared to the other planes, but that there are some artefacts, which are corrected with the weighted average.

Comparison of 2.5D multi-class segmentation algorithms

We will now examine the differences between the algorithms we have implemented, in order to show the effect of the Attention Gates algorithm. We have calculated the different metrics for the multi-class segmentation algorithm without the attention gates and by changing the Loss Function (Dice Loss, Tversky Loss and Dice/Focal Loss). And we compare them to the metrics of the segmentation model with Attention Gates combined with Dice/Focal Loss. All models use the weighted average but not the post-processing based on the connected components. These metrics are grouped in As for the study on the different cutting planes, we will start by studying the quality of the predictions by comparing the values obtained for Precision. We can see that on the average of the lobes, the algorithm with the Attention Gates seems to have the least segmentation error with 95.08% precision. However, the other algorithms are not far behind with 94.65% for the algorithm trained with Dice/Focal Loss,94.68% for the one with Tversky Loss and finally 93.96% for the algorithm based on Dice Loss. However, taking the classes one by one, we observe that it is not necessarily the version with the Attention Gates that performs best, but still tends to be quite close to the best results when it is not the best.

On the right side of the respiratory system, the Attention Gates algorithm has an average precision of 96.60%, 75.40% and 93.96% for the upper, middle and lower lobes respectively. Except for the upper lobe, where the Tversky Loss algorithm seems to be a bit better, than the other algorithms, with 97.01%, the Attention Gates algorithm has the lowest error rate on the right side. Overall, the algorithms tend to perform quite well on the upper lobe with at least 96.60% of precision. The middle lobe was more difficult to segment with low precision scores of only 71.83% for the Dice Loss algorithm and only 75.40% for the Attention Gates algorithm. Finally, for the lower lobe, the measurements are quite close with values between 92.83% and 93.96%, which means that the algorithms make few errors on their segmentation. For the left lung, the Attention Gates algorithm is not the best performer for the upper lobe but is within one point of the best algorithm as the different algorithms are very efficient on the left side. For the left upper lobe, the Dice Loss algorithm has the best precision with 99.21% and the Attention Gates algorithm is the least accurate with 98.65% precision which is still excellent. Conversely, further down the lung, the Dice Loss algorithm under-performs with 94.40% precision, where the Attention Gates algorithm is the top scorer with 97.53%. Finally, for the airways, the Dice/Focal Loss algorithm only scores 93.29%, while the Dice Loss algorithm comes out on top with 97.73% precision. The Attention Gates algorithm tends to have more errors with a precision of 96.97% on the classification of the first lung branches, which is still an excellent result.

Let's now look at the values of the Recall which as with the Precision measurements, it is once again the Attention Gate algorithm that performs best, on average, over the lobes with a Recall of 95.61%. The Dice/Focal Loss algorithm performed very slightly worse with a 95.21% Recall, while the Dice Loss and Tversky Loss algorithms lagged behind, with 94.03% and 94.72% Recall respectively. The values observed on the right upper lobe show that the algorithms do not capture the entire lobe, with the Attention Gates algorithm achieving 88.75% Recall, making it the best performing algorithm. As with the cross-sectional planes, this setback to Precision is mainly due to the many errors caused by the segmentation of the middle lobe, which then incorporates some elements of the upper lobe. Speaking of the right middle lobe, we can see that, despite the errors, a large part of this lung lobe is segmented with a Recall of 91.46% for the Dice/Focal Loss algorithm, which places it at the top of the list. The Attention Gates algorithm is closer to the other two with 90.19% Recall. In the lower lobe, the algorithms capture a minimum of 97.97% of the volume, with the Tversky Loss algorithm rising to 98.39% for the Attention Gates algorithm, but the range of value is really small and so, all the algorithms can be used for this part of the right lung. Since on the left side there are only two lobes, the errors found by the Precision on one lobe have a direct impact on the Recall value observed for the opposite lobe. This is why we notice that the results are similar to those seen with the precision, for the opposite lobes. Indeed, for the upper left lobe, the results are equivalent to those observed for the lower lobe precision with the best Recall observed for the Attention Gate algorithm, which is equal to 98.05% while the Dice Loss algorithm has a score of only 95.02%. On the lower side, the Dice Loss algorithm occupies the most space with 99.03% Recall, while the other algorithms are also quite close to this value with, for example, the Attention Gate algorithm which has a Recall of 98.66%. For the bronchial tree, we still have the problem of segmentation, as our algorithms only detect at most three quarters of the expected volume. The Dice/Focal Loss algorithm performs best with a recall of 77.49% but is closely followed by the Attention Gate algorithm, which uses the same loss function, with 76.39% recall.

Let's take a look at the balance between Precision and Recall with the F1-Score, where we notice that the Attention Gates algorithm is the best algorithm with a good balance between quality and quantity. Apart from the right middle lobe, the Attention Gates algorithm performs best in the other classes with 92.58% on the right upper lobe, 96.16% on the right lower lobe, a minimum of 98% on the left side of the respiratory system, 85.34% for the Bronchial Tree and a global average of the lobes equal to 95.37%. For the right middle lobe, the F1-Score displayed by the Attention-Gates algorithm is 82.29% and is only slightly exceeded, less than 0.02 points, than the Dice/Focal Loss algorithm.

As for the comparison between the segmentations obtained in the different planes, we also have, with Table 2.5, a visual comparison of the results according to the algorithms used, where we observe once again the problems caused by the errors made on the left middle lobe. Once again, the lack of detection of the bronchial tree can be seen.

Benefits of post-processing via connected components

Finally, to finish with the comparisons, we will now observe the differences between the use or not of the correction with the connected components. For this, we have a new table grouping the metrics between the Attention Gates algorithm with the weighted average and with or without post-processing.

Looking at the metrics obtained in the Table 2.6, it can be seen that there is a slight improvement between the version without post-processing and the one with post-processing. However, if we look at the visual representation in the Table 2.7, we can see the advantage of using the connected elements method to refine and correct the visible artefacts. In the representation of the coronal slice, one can see for the version without post-processing, red spots, corresponding to the lower right lobe located at the bottom left of the orange area, corresponding to the lower left lobe. These red spots have been removed using the connected element method.

Discussion

We will now compare our Attention Gates algorithm with the weighted average and the correction by connected components with the different trained algorithms as well as with the Among the algorithms in the literature, the one that performs best is the algorithm of Gu et al., who, like us, have developed an algorithm using 3D and 2D, but they should not be confused because the algorithm of Gu et al. always uses a 3D architecture, with a V-Net, which requires a lot of resources to train it. Our algorithm only uses 2D segmentations, and only exploits 3D for predictive reconstruction and the fact that we get a different segmentation on the 3 axes of the CT-Scan. It is therefore easier to train and requires fewer resources, and it performs well as our results are most often close to or even superior to those obtained by the other algorithms.

Focusing on the average of the lung lobes, we have a F1-Score of 95.37% which is 2.37% higher than the Ferreira et al. algorithm, a little less than 4% higher than the Tang et al. algorithm and 1.47% higher than the algorithm of Imran et al., for the others algorithms we don't have the information on the global average of the lobes. Looking on the right side of the respiratory system, we notice that the algorithm of Gu et al. is the most homogeneous with F1-scores of 95.07%, 90.03% and 94.84% for, respectively, the upper lobe, the middle lobe and the lower lobe. Our algorithm is slightly behind the latter for the upper and lower lobes with 92.58% and 82.29% respectively. We explain this because our algorithm tends to make errors on the middle lobe, as shown by our value for Accuracy, which then scrapes pixels from the upper lobe, with only 88.84% Recall, where the algorithm of Gu et al.. Nevertheless, the right middle lobe is, for all algorithms, the one where the F1-Score always seems to be one notch lower. One explanation for this is that it is the smallest of the five lobes and therefore the variation is greater because there are fewer pixels. For the lower lobe, our algorithm is, this time, the best performing with 96.14% F1-Score, 93.39% Precision and 98.39% Recall. The closest algorithm, in terms of balance between quality and quantity, is the Imran algorithm which achieves an F1-Score of 95.60%, the other algorithms are a little further behind with the Gu et al. algorithm achieving 94.84% of F1-Score. We can also see, at the level of the Recall, that our algorithm captures a greater part of the lower volume compared to the algorithm of Gu et al. which is situated 2 points below ours. For the left lobes, our algorithm is the most efficient with an F1-Score higher than the minimum of 1.5%, for both lobes, compared to the other algorithms. For the upper lobe, we have an F1-Score of 98.63%, whereas the algorithm of Gu et al. achieves "only" 96.60% of F1-Score, which is still excellent. The algorithm of Gu et al. captures slightly better the upper volume with 98.23% of Recall, which means that for this lobe this algorithm seems to commit more errors than our version. These errors are reflected in the lower lobe, where the Gu et al. algorithm scores 96.60% for F1-Score and 96.14% for Recall, whereas our version of this work scores better with 98.10% for F1-Score and 98.69% for Recall.

Ideas of improvements

We propose in this section several ways to improve the models. They could not be implemented in the frame of this thesis due to a lack of time, but they are discussed in the next paragraphs. It is also an opportunity to talk about other projects, all close to the work presented. These projects will be presented throughout this section.

As we have explained, the segmentation of the lung lobes is a rather complex task. And new methods appear every year such as the contribution of Generative Adversarial Networks [START_REF] Chen | LLASN:Lung lobes segmentation using adversarial network[END_REF], other approaches linking 2D and 3D segmentation algorithms [START_REF] Gu | A 2D3D hybrid convolutional neural network for lung lobe autosegmentation on standard slice thickness computed tomography of patients receiving radiotherapy[END_REF], or methods using only morphological properties [START_REF] Peng | Pulmonary Lobe Segmentation in CT Images Based on Lung Anatomy Knowledge[END_REF]. The Generative Adversarial Networks is a type of learning algorithm for creating new training data. We had several considerations to improve our model but also to propose other approaches for segmentations.

Skeleton of the lobes

The first idea for improvement is to work on the skeletons of the 3D lung models. The principle would be to create a skeleton from a 3D mesh of the lungs and a correspondence between the points of the mesh and those of the skeleton. The skeleton would then be subdivided into two or three sub-skeletons, depending on the lung, and the lobes reconstructed using correspondence mapping.

To get the 3D model of the lungs, we use our binary segmentation algorithm. To generate the skeleton of these 3D models, we rely on a mesh contraction algorithm, named "Mean Curvature Flow Skeleton", developed by Tagliasacchi et al. [START_REF] Tagliasacchi | Mean Curvature Skeletons[END_REF]. The Figure 2.7 shows the result of this algorithm applied to the left lung of a patient from the LIDC-IDRI library [START_REF] Armato | The Lung Image Database Consortium (LIDC) and Image Database Resource Initiative (IDRI): A completed reference database of lung nodules on CT scans[END_REF] in the LUNA16 [START_REF] Arindra | Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: The LUNA16 challenge[END_REF] competition database. With this simpler representation of the lung, my goal would be to develop a method for dividing this skeleton in two and reconstructing the lobes from the two skeletons. Then, I plan to generate a database of lung skeletons and on the separation of these skeletons in order to set up supervised learning to create this separation directly. Before, we needed a proof of concept to validate the idea and implement this new method. To start with, we chose to focus on the left lung, where there is only one fissure, and whose segmentations are obtained, by our previous algorithm, are very accurate. With the segmentations of the left lobes, we were able to determine which part of the skeleton belonged to the upper lobe and the lower lobe (Cf. Fig 2 .7). The "Mean Curvature Flow Skeleton" algorithm allows to get a correspondence between the skeleton points and the mesh nodes making it possible to reconstruct the lobe meshes. In addition to this, we have also established our own correspondence based on the minimum distance between a mesh node and the skeleton. We made this choice analysing the "Mean Curvature Flow Skeleton" algorithm, which does not necessarily connect the mesh points to the nearest node of the skeleton. Figures 2.8 and 2.9 shows the distances measured when using the "Mean Curvature Flow Skeleton" node mapping and the distances measured when using the correspondence based on the minimum distance between a mesh node and the skeleton. Some nodes, in the case of the "Mean Curvature Flow Skeleton" correspondence, are quite far from their skeleton reference node which leads to a larger margin of error in the reconstruction. We divided the skeleton into two parts, the part of the upper lobe, and the part of the lower lobe. For this, we used the segmentations of the left lobes, obtained with the 2.5D multi-class segmentation algorithm.

With the lung lobe segmentations, we could then determine which part of the skeleton was located in the upper lobe and which part was located in the lower lobe. Once we have the correspondence of the points and the skeleton division, we can define which points of the mesh are associated with the upper and lower lobes, see Figure 2.10. The Figure 2.10 shows the lobe meshes according to the point matching method. There is a significant difference between the two results obtained and the desired result. This margin of error is linked to the contraction of the information as we go from a mesh with several tens of thousands of points to a skeleton with less than a thousand. Following this, we propose to refine these results by creating a mesh of the fissure obtained, in order to smooth this mesh. Smoothing the mesh will result in a less discontinuous fissure.

Spline method

We search for a way to define a cutting plane to subdivide the skeleton in two. To do this, we used the segmentation of the bronchial tree that we obtained with our multi-class 2.5D segmentation algorithm. The segmentation allows, in addition to the lung structures, to have the location of the first generation of the bronchial tree. By applying "Mean Curvature Flow Skeleton" on the mesh of the bronchial tree, we to obtain a simplified tree, we are then able to obtain the two left lobar branches and the associated section plan (see Figure 2.12b). We then took up the basic idea of the bronchial tree generation algorithm, where the cutting plane is defined using the sister branches, i.e. the two branches originating from a parent branch at a bifurcation. Subsequently, we calculated the distance between this cutting plane and the points defining the left fissure. These points are extracted from the patient's ground-truth associated with the bronchial tree. And at the same time we also calculated the distance between the plane and the points of the left fissure from the prediction obtained with our algorithm, which we presented in the chapter on segmentation. The Figure 2.8 then shows the distance distributions for the ground truth and for the prediction. As for the average, for the distance with the ground truth, we have 10 ± 5mm and, for the distance with the prediction, we have 13 ± 7mm. This means that the cutting plane is finally quite close to the fissures, but that this error combined with the error induced by the skeleton would not have been sufficient without anu other improvements to define a new algorithm of lobe subdivision. Despite this, measuring the distance between the cutting plane and the different fissures (Cf Figure 2.11), has given us a new idea which, if not to define a new segmentation method, could allow us to refine our previous segmentation. The idea that we have, would be to create a predictive algorithm aiming to take as input the B-Splines surface associated to the fissure obtained with the prediction (Cf Figure 2.12c) and to get as output the B-Splines surface associated to the fissure of the ground-truth (Cf Figure 2.12a). Thus, after obtaining the segmentation via our segmentation algorithm, we could fit a b-splines surface associated with the fissure, and using the new predictive algorithm adapt the coefficients of this B-Splines to obtain a better fissure. Predictive algorithms using B-Splines are already present in the literature [START_REF] Fey | SplineCNN: Fast Geometric Deep Learning with Continuous B-Spline Kernels[END_REF][START_REF] Laube | Deep Learning Parametrization for B-Spline Curve Approximation[END_REF], but their use is still quite rare. Using the G+smo library [START_REF] G+smo | [END_REF] (known as Gismo) we were able to create a first example of B-Splines of the different fissures we have (Cf. Figure 2.13). The contribution of B-Splines on this type of data allows us to reduce the number of components and thus simplify the implementation of the refinement of the predictions already

Conclusion

In this chapter we have presented our algorithm of segmentation of the pulmonary lobes and of a part of the bronchial tree. This algorithm is largely based on 2D segmentation from a U-Net architecture, in which we have included Attention Gates. This algorithm also has the particularity of working on the three axes of the CT-Scans, to perform the segmentation on each axis and to extract information from each of these segmentations to create our prediction. Therefore, this algorithm does not require a lot of computer hardware resources for training or for its execution and can potentially be easily used by radiologists or doctors. The predictions are very encouraging and show that the 3D algorithms are not more efficient. In particular for the left lobes of the lung, for which our algorithms often obtain better results. The right lobes are more complicated to segment but in comparison with more costly algorithms, the results are close and could even be improved with training on a higher number of patients and by using post-processing methods based on anatomy structures like the blood vessels. In addition to the lobes, we segment the first generations of the bronchial tree. This part also needs to be improved with only three quarters of the tree visible on the digital images is segmented by our algorithms.

The segmentation algorithm I developed in my thesis was also used in a parallel project to segment the aorta. The goal was to detect calcifications (calcium accumulation) in the aorta. The aorta is the largest artery in the human body, it takes root in the left ventricle of the heart and descends all the way down the abdmonen to irrigate both legs. With age and/or cardiovascular risk factors, such as smoking, high blood pressure, etc., calcium deposits can develop in the wall of the aorta. They are called calcifications and can cause clots if they break off. We then worked on CT scans of the abdomen to detect such calcifications, using our work from the lung lobe segmentation. We created the database from the images obtained by manual segmentation of the aorta and calcifications. We trained our algorithm to generate the segmentation automatically. The Figure 2.14 shows an example of the results obtained. Hence, this study shows that our algorithm is not limited to lung lobe segmentation but that its training could be extended to other subjects.

Introduction

In the previous chapter, we set up a segmentation algorithm using Deep Learning, to obtain estimations of the position of the different elements of the lower respiratory system, the 5 lobes of the lungs and the two or three first generations of the bronchial tree. Mathematical models and numerical simulations are commonly used to describe and analyse phenomena related to the respiratory system, in particular for intra-bronchial activity. For instance, numerical simulations have been used to study gas exchange with the blood, aerosol deposition [START_REF] Noël | Interplay Between Optimal Ventilation and Gas Transport in a Model of the Human Lung[END_REF][START_REF] Petersson | Gas exchange and ventilationperfusion relationships in the lung[END_REF] or gas transport in relation to a disease [START_REF] Stéphano | Wall shear stress distribution in a compliant airway tree[END_REF][START_REF] Mauroy | Interplay between Geometry and Flow Distribution in an Airway Tree[END_REF][START_REF] Wall Wa Comerford | Structured Tree Impedance Outflow Boundary Conditions for 3D Lung Simulations[END_REF]. Most of the studies in the literature are based on generic bronchial tree models that do not reflect the specific morphology of the actual patients. A way to improve the predictions of these models is to use detailed and realistic models of the morphological structures of the pulmonary lobes, and of the bronchial tree. The latter is, in various works, often represented by generic models of the respiratory system that do not necessarily reflect the morphology of the actual patients. This simplification is due, amongst other causes, to the lack of a complete mesh of the respiratory system. Currently, most of these meshes stop at the 4th-5th generation, as obtaining an accurate model of the whole bronchial tree is not an easy task.

As discussed in the introduction, the human lung is a complex biological structure consisting in a bronchial tree and in an exchange surface with blood of about 70 square-meters that is folded in the thorax. The bronchial tree is an asymmetrical cascade of bifurcating airways that puts in contact the ambiant air with the exchange surface, using a mechanism called ventilation. Ventilation consists in periodic internalizations and externalizations of a volume of air. This system includes the airways, which are used to transport oxygen from the environment into the bloodstream, the lungs, which contain part of the airways, and the diaphragm, which carries out the physiological processes of inspiration and expiration. The airways can be divided into upper and lower; both allow for air from the outside to pass into the alveoli, where various gas exchanges with the blood capillaries take place. The upper respiratory tract consists of the nose, nasal cavity, mouth, pharynx and larynx. Their role is to filter, warm and humidify the inspired air. They are also responsible for the sensory functions of taste and smell, and are also producing sound. The lower airways, which we seek to model, consists of the trachea, bronchi, bronchioles, acini and alveoli. Between the trachea and the aveoli, there are between 18 and 40 bifurcations, with an average of 23 generations of airways. Of these 23 generations, a part is only used for gas transport and is not involved in exchanges with the blood, the bronchial tree or conducting zone. This set consists of about 17 generations of cylindrical structures forming an asymmetric dichotomous tree, through which the gases flow either by convection or diffusion, depending on the generation. After these 17 generations, we enter the acinus, which is also called the respiratory zone, and is the place where gas exchanges with the blood take place. It is also a dichotomous tree extending over about 7 generations and whose cylindrical walls are increasingly lined with alveolar sacs which are in contact, via a thin membrane (between 0.2 and 0.5 um) with the blood.

Due to the complexity of the lung structure, direct measurements and observations in the organ are difficult to perform experimentally.

The first morphometric measurements and generic model of the bronchial tree were obtained using lung casts, as reported in the work of Weibel et al. [START_REF] Weibel | Fractal geometry: a design principle for living organisms[END_REF][START_REF] Ewald | Morphometry of the Human Lung[END_REF] or Horsfield et al. [START_REF] Horsfield | Computer simulation of the geometry of the human bronchial tree[END_REF][START_REF] Horsfield | Diameter, length and branching ratios in the bronchial tree[END_REF][START_REF] Horsfield | Models of the human bronchial tree[END_REF][START_REF] Horsfield | Morphology of branching trees related to entropy[END_REF][START_REF] Horsfield | Morphology of the bronchial tree in man[END_REF].

The model of bronchial tree defined by Weibel et al., called the Weibel's A-model is a regular dichotomous tree containing 23 generations of branches. Each bifurcation is defined by a mother branch and two resulting daughter branches, called sister branches to each other. A mother branch and a daughter branch define an angle of 35°, that is often referred to as the "branch angle". The simplicity of Weibel's A-model resides in the symmetry of the airways bifurcations, which makes the model tractable. It is the most widely used. This model is composed of cylindrical tubes, and the branches of the z-th generation have the same geometrical properties (diameter and length) and are defined by :

D(z) =    D 0 • e -0.388z , if z ≤ 3, D 0 = 1.8cm D ′ 0 • e -(0.2929-0.00624z)z , if z > 3, D ′ 0 = 1.3cm (3.1) L(z) =    L 0 • e -0.388z , if z ≤ 3, L 0 = 12cm L ′ 0 • e -(0.2929-0.00624z)z , if z > 3, L ′ 0 = 2.5cm (3.2)
This symmetric version speeds up the computation time to obtain solutions to models using bronchial tree structures. Since each path is the same between the entrance to the bronchial tree (trachea) and the exits from these trees (bronchioles), the governing equations of the models, for example for gas transport, are also identical. Therefore, it is sufficient to solve them once. Although the predictive qualitative power of this model has been proven at many occasions [START_REF] Noël | Interplay Between Optimal Ventilation and Gas Transport in a Model of the Human Lung[END_REF][START_REF] Brunengo | Optimal efficiency of high-frequency chest wall oscillations and links with resistance and compliance in a model of the lung[END_REF][START_REF] Mauroy | An optimal bronchial tree may be dangerous[END_REF][START_REF] Noël | The origin of the allometric scaling of lung ventilation in mammals[END_REF], the model is not able to account for the variability in the geometry of the airways such as asymmetrical branching.

Like Weibel et al., Horsfield and Cumming have also made morphometric measurements on bronchial tree casts, from which they have defined a model where the branches have an average asymmetry. In addition to the asymmetry, this model also differs in the numbering of the generation. In his symmetrical model, Weibel defines the numbering starting from the trachea, to which he assigns the order 0, and then at each bifurcation the order of the generation is incremented by 1 with respect to the parent branch. In their model, Horsfield and Cumming defined the numbering starting from the terminal branches, as shows in the Figure 3.1, so that the order zero is associated with the terminal branches, and the order of the mother branch is the highest order of the daughter branches incremented by one. In addition to this new notation, different data, obtained from their moulding, were used to define the model. For example, the branching ratio, which corresponds to the factor of increase in the number of branches between two successive generations, is defined as 1.38 or the number of distal respiratory bronchioles is estimated to be around 224,000. However, the limitation of this model is that it does not take into account the spatial position of the branches.

Horsfield et al. also set up another asymmetric model, a δ model, where δ is the difference in order between two daughter branches and the larger the delta, the more asymmetric the tree. Despite the fact that these models are 50 to 60 years old, they are still regularly used they Taken from [START_REF] Horsfield | Computer simulation of the geometry of the human bronchial tree[END_REF] are based on detailed observations of the bronchial tree. Nevertheless, the limitation of these models is that they do not take into account the spatial position of the branches.

Later on, in the wake of the progress in terms of computing power, three-dimensional asymmetric branching models were developed, such as Kitaoka's model [START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF] or Tawhai's model [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF]. The first one is based on Murray's law, which relates the flow rate through a segment of a living organ to the diameter of this segment. The Kitaoka's model describes a system of branching ducts based on two principles: 1/ the amount of air flow through a branch is proportional to the volume of the region fed by that branch; and 2/ the terminal branches of the tree are homogeneously distributed within the organ. The branches are built using an algorithm that consists in nine basic rules for generating the tree structure. Then, four other rules have been added to adjust the lengths, diameters and branching angles to the morphometric observations. This model allows for a more isotropic division of the lung space and corresponds to air flows distribution in the airway tree that minimizes the viscous dissipation. This model has the advantage of being fully deterministic, and was used successfully to reconstruct a model of the bronchial tree in an idealised chest cavity. The model has however some difficulties to represent satisfactorily the morphometric data. Nevertheless, this pioneer work represents a crucial step towards more realistic algorithm-based 3D reconstructions of the bronchial tree.

Shortly after the model of Kitaoka et al. was published, another airways reconstruction algorithm was proposed by Tawhai et al.. This new algorithm produces a tree that is the most accurate as of today in terms of morphometric representation of the bronchial tree [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF][START_REF] Merryn | CT-based geometry analysis and finite element models of the human and ovine bronchial tree[END_REF]. The method is based on the work of Wang et al. [START_REF] Wang | Bifurcating distributive system using Monte Carlo method[END_REF], which describes a method for subdividing a two-dimensional domain defined by a cloud of points. Tawhai et al. extends the technic of Wang et al. model to 3D and adapts the subdividing process to include lung morphologic constraints. The airway tree is grown from the sub-volumes generated by the successive subdivisions of the lung envelope. As for the Kitaoka et al. algorithm, the Tawhai algorithm depends on a list of rules for the growth of the tree and on a set of corrections of the branch length and angle. The corrections make sure that the generated tree respects the morphometric data.

More recent techniques [START_REF] Bordas | Development and Analysis of Patient-Based Complete Conducting Airways Models[END_REF][START_REF] Montesantos | The Creation and Statistical Evaluation of a Deterministic Model of the Human Bronchial Tree from HRCT Images[END_REF]

Data and extractions of the morphological structures

The model of the bronchial tree is divided in two parts. The first part corresponds to the large airways. They are reconstructed directly from the scanners of the patient, see section 2. The second part corresponds to the small airways, which are not visible on the scanners. This work focus more particularly on this second part and develops a new algorithm that builds these small airways. The algorithm takes as input the meshes of the geometry of the large airways and of the lobes of the lung. The technic developed in this work is based on a set of successive steps.

Scanners data

We use a dataset from a large public medical imaging library: the Lung Image Database Consortium (LIDC-IDRI). This library includes over a thousand lung patients and has been used numerous times for deep learning and artificial intelligence challenges, such as LUNA16 [START_REF] Arindra | Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: The LUNA16 challenge[END_REF]. In this last competition, CT-scans from 50 patients were provided, and the resulting extracted morphological structures were made available to the public thanks to the work of Tang et al. [START_REF] Tang | Automatic Pulmonary Lobe Segmentation Using Deep Learning[END_REF]. The extraction are based on 3D matrix. Each element of the 3D matrix corresponds to a voxel in the CT-scan and is a label that represents a single morphological structure: the lung lobes and the large airways.

Surface meshes building

The surface meshes are built using the marching cubes algorithm [START_REF] Lorensen | Marching Cubes: A High Resolution 3D Surface Construction Algorithm[END_REF]. This method, often used in the medical field, allows to get the boundary surface of a group of voxels with the same label in a 3D matrix and to recover a corresponding surface mesh. Several meshes are built: the surface meshes of the pulmonary lobes and the surface mesh of the large airways of the bronchial tree, see Fig. 3.2.

CT-Scan Segmentation

Voxel matrix Surface mesh

Simplification of the lobar meshes

For the lung lobe meshes, the work consists in smoothing the meshes and simplifying them by reducing the number of faces and therefore their number of nodes. The marching cubes step produces meshes with stair-like features in the direction perpendicular to the CT-scan slices and with about 100 000 faces. To correct the stair-like effects, we will apply a Laplacian Smooth method, which allows to reduce the noise of the marching cubes while preserving the morphology. Thus, for each vertex, we will calculate new positions based on the adjacent vertices using the following definition :

xi = 1 N N j=1 xj (3.3)
Where N is the number of adjacent vertices of the i-th node, xi is the new coordinates of the i-th node and xj is the position of the j-th adjacent vertex. Following this method, we use the "Quadric Edge Collapse Decimation" to simplify the smoothed mesh [START_REF] Cignoni | Preserving attribute values on simplified meshes by resampling detail textures[END_REF][START_REF] Garland | Surface simplification using quadric error metrics[END_REF], whose part of the iterative methods of egdes contraction. We then move from a mesh with more than 100,000 faces to a mesh with only a few thousand faces while preserving the topology of the mesh. This reduction is really helpful for the generation of the bronchial tree because it decreases the computational effort required to generate the skeleton of the bronchial tree.

Skeleton of the bronchial tree

For the morphology of the bronchial tree, the process is different, the goal is to represent the bronchial tree topology and airways length using a skeleton. A skeleton is a set of nodes connected by edge. We search for the minimal skeleton, i.e. a skeleton with a number of edges equal to the number of airways that we want to represent. The edges of the minimal skeleton will then represent airways of the bronchial tree. To each edge of the minimal skeleton will be associated a diameter value representing the characteristic diameter of the corresponding airway.

We extract a non-minimal skeleton of the first three generations of the airways from the CT-scans, see Fig. 3.4. This skeleton is generated using the "Mean Curvature Flow Skeleton" technic, developed by Tagliasacchi and al [START_REF] Tagliasacchi | Mean Curvature Skeletons[END_REF] and implemented in the CGAL library [START_REF]The CGAL Project[END_REF]. This technic is based on mesh contraction, but differs in the management of intersections. In the classic contraction method, intersections are not well approximated and three-branches intersections could be represented with three connected nodes instead of a single point of intersection. In the "Mean Curvature Flow Skeleton", an edge collapse step is performed, this mean that for a given edge joining two vertices, the edge-collapse operation replaces the edge and the two vertices by only one vertex. This results in a skeleton that respects the bronchial tree structure.

Nevertheless, the skeleton remains complex because it follows perfectly the curve of the bronchial tree's surface mesh. We proceed with a supplementary step of simplification to get the minimal skeleton. We browse the nodes of the non-minimal skeleton and keep only the nodes connected to a single edge (nodes forming the extremities of the skeleton) and the nodes connected to three edges or more (nodes at the intersections of the branches of the skeleton). Two nodes of the minimal skeleton are connected by an edge if, in the non-minimal skeleton, all the nodes in the path between these two nodes are connected at most to two edges. The minimal skeleton forms a tree with straight branches, this property will be crucial for generating the small airways.

3: Simplification of the lobes surface meshes

There is still a final step, that classify the branches, to identify the major branches : trachea, pulmonary airways and lobar airways. First, to obtain the trachea, it is simply a question of recovering the edge associated with the largest diameter, and the two daughter branches of the trachea then correspond to the pulmonary airways. For the lobar branches it is a little more complex, because with segmentation there can be branch artefacts which mean that we cannot necessarily base ourselves on the daughter branches of the pulmonary branches to obtain the lobar branches. For this, we search which lung lobe is associated to each terminal branch of the simplified skeleton, either by checking if the end point of the terminal branch is in one of the lobe mesh, or by determining which lobe mesh is intersected by the half straight line stemming from the terminal branch :

• "LU" for the upper left lobe.

• "LL" for the lower left lobe.

• "RU" for the upper right lobe.

• "RM" for the middle right lobe.

• "RL" for the lower right lobe.

We simply have to go upstream in the tree by giving the mother branches, the value of the daughter branches, thus making it possible to know which lobes are irrigated by a branch. The identification of the major branches is now trivial, we just look at the lobes served by a branch, and then we have :

• Trachea : ń LU ż, ń LL ż, ń RU ż, ń RM ż, ń RL ż.

• Left pulmonary branch : ń LU ż, ń LL ż.

• Right pulmonary branch : ń RU ż, ń RM ż, ń RL ż.

• Upper left lobe branch : ń LU ż.

• Lower left lobe branch : ń LL ż.

• Upper right lobe branch : ń RU ż.

• Intermediate right lobe branch : ń RM ż, ń RL ż.

• Middle right lobe branch : ń RM ż.

• Lower right lobe branch : ń RL ż.

In addition, this confirms the detection of the trachea and the pulmonary branches. This last step concludes the initial conditions extraction for the airways generation algorithm.

The basic algorithm

Bronchial tree is comparable to a space-filling structure. This growth is a repetition of dichotomous bifurcations of the branches into geometrical models of the lung lobes.

Two main algorithms are proposed in the literature. The first, developed by Kitaoka et al. [START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF] is based on the optimisation of gas transport using Murray's law, and the second, developed by Tawhai et al. [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF], is based on the methods of subdividing a volume containing a point cloud.

Model of Kitaoka et al.

Kitaoka's model [START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF] is based on Murray's Law [START_REF] Murray | The Physiological Principle of Minimum Work[END_REF], which relates the flow rate in a segment of a living organ to the diameter of the segment. The generated model is a system of branching ducts that is based on two principles: 1) the amount of air flow through a branch is proportional to the volume of the region served, 2) the terminal branches of the tree are homogeneously arranged within the organ. To use Murray's law, we assume that the branch in a living organ is cylindrical, rigid and with a constant diameter. Then, we have the following relationship:

Q = Cd n (3.4)
Where Q is the flow rate, C is a constant that depends on the organ and the fluid, d is the diameter and n is also a constant called the diameter exponent. From this equation and the principle of conservation of flow, we can deduce a relationship between the diameter of a mother branch and the diameters of its daughter branches:

d n 0 = d n 1 + d n 2 ⇒      d 1 = d 0 r 1 n 1 d 2 = d 0 r 1 n 2 (3.5)
With d i the diameter of the mother branch (for i = 0), and the daughter branches (for i = 1, 2), r i the flow-dividing ratio between the mother branch and the daughter branches and n, a constant called the diameter exponent, equal to 2.8 from estimation of Kitaoka et al. In the same way as for the diameter, we can also deduce from Murray's law, an equation allowing us to calculate the optimal branching angle for the air flow:

d 2 0 sin (θ 1 + θ 2 ) = d 2 1 sin (θ 1 ) = d 2 2 sin (θ 2 ) ⇒                  cos (θ 1 ) = 1 + r 4 n 1 -(1 -r 1 ) 4 n 2r 2 n 1 cos (θ 2 ) = 1 + r 4 n 2 -(1 -r 2 ) 4 n 2r 2 n 2 (3.6)
Where d i , r i are the same variables as for the diameter, however unlike the diameter here, n has a value that depends on the type of flow (3 for a laminar flow and 2.333 for a turbulent flow). θ i is the branching angle between the mother branch and the daughter branches. The algorithm is based on 9 basic rules for the generation of the tree structure, on top of that 4 additional rules have been defined in order to have a more isotropic division of the space.

1. Branching is dichotomous.

2. The mother branch and the daughter branches are in the same plane, called the branching plane.

3. The volumetric flow rate is conserved between the mother branch and the daughter branches.

4. The volume supplied by a mother branch is divided in two by a plane called the "spacedividing plane". This plane is perpendicular to the branching plane.

(a) If |θ 1θ 2 | ≥ 10°the space-dividing plane is redefined using the bisector of the two daughter branches.

5. The flow-dividing ratio r is defined using the volumes served by the mother and daughter branches respectively, with the following formula : r i = V i V 0 . 6. Diameters and branching angles are then determined by using the previous equations. (a) If θ i ≥ 80°then an angle correction algorithm is applied.

7. The length of the daughter branches is equal to three times their diameter. The ratio between the length and the diameter is called the length-to-diameter ratio.

(a) If the branch exits or is too close to the edges of the volume, a "Distance-To-Length Ratio" (DTLR) is defined using the points of the daughter branch (P 0 is the starting point, P 1 is the end point) and the point of intersection (P 2 ) of the daughter branch with the volume edges with the equation : P 0 P 2 /P 0 P 1 . The value of the length-to-diameter ratio is initially set at 3. This value is reduced in steps of 0.25 until the "Distance-To-Length Ratio" is defined between 3 and 6. The value of the length-to-diameter ratio needs to be higher than 1.

8. If the daughter branch becomes a mother branch, the previous steps are repeated using a plane branching perpendicular to the plane branching of the mother branch.

(a) If the volume subdivision results in a volume that is too small, i.e. if the flowdividing ratio is below a threshold value, then a rotation of plus or minus 9°will be applied to the branching plane until the ratio is above the threshold value.

9. The branching process is stopped if the flow rate becomes less than a threshold.

This algorithm allows an optimisation of the flow through the bronchial tree, and has the advantage of being completely deterministic. However, the examples presented are generated in idealised lung structures, and do not fully match the morphometric data. Shortly afterwards another algorithm, proposed by Tawhai et al. [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF], based on a different method, allowed a better match with the morphometric data. The model of Tawhai et al. [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF] is based on the work of Wang et al. model [START_REF] Wang | Bifurcating distributive system using Monte Carlo method[END_REF] which describes a method of subdividing a two-dimensional space using a Monte-Carlo method to generate a point cloud. The papers from Tawhai et al. describe the modifications made to the Wang et al. model to move from the dimension two to the higher dimension and to adapt some parameters to better fit the morphological data. The first problem requires redefining the geometry separating the point cloud. In 2D, the separation is done with a line, while in 3D this separation is done with a plane. This modification is explained by the fact that the point cloud is contained in a surface in the 2D model, and by a volume in the 3D extension. This plane is defined by the line going to the center of mass, but there can be an infinite number of planes defined by only this line. This is why the mother branch is used to define the cutting plane. In addition to the redefinition of the separating geometry, the method for generating the points has also been changed, so that the Monte-Carlo method is replaced by an arbitrary grid. This grid is constructed by generating points that are placed at the same distance from each other, and then removing all points that are not contained in the geometry of the lungs.

Subsequently, a serie of constraints and corrections was introduced to ensure that the generated tree was close enough to the morphological data. These constraints apply to the length of the branch, the branching angle (the angle between the parent and the daughter branch) or the minimum size of a volume to be filled. The limiting length of the branch is defined by the length of a terminal bronchiole, which is set between 1 and 1.5 mm. For the size of a filling volume, two conditions are fixed, either the group of points is less than a fixed number, or the size of the volume must be larger than the size of an acinus. Finally, when creating the branch, a last check is made on the branching angle, which must not exceed 60°, otherwise it is corrected. The algorithm can then be described in a few key steps :

1. The points of the grid are grouped into groups, according to their proximity with the branch [cf 3.6a].

2. The cutting planes are defined by using the branch and it mother branch, then the groups of points are divided into sub-groups [cf 3.6b].

3. The center of mass of each sub-group is computed [cf 3.6b].

4. The new branch is created using the line drawn through the branch arrival point and the center of mass [cf 3.6c], and a correction of the parameters (length and angle) is applied if necessary.

5. The steps are repeated until the sub-group contain only one point. Then the branch is terminal.

The arbitrary grid remains a good tool for approximating volumes. However, in order to maintain accuracy, it is important to generate a large number of points, as the density of points has a great influence in the center of mass calculations. Tawhai et al. [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF] set a minimum number of points for the computation of the barycentre, which is not indicated in the paper.

However, these models are quite old and computer tools have evolved enormously over the last two decades, which makes it possible to define new methods of computation and geometric representation. We worked on an updated version of this model, in order to free ourselves from the constraints linked to the point cloud, and to focus on the use of morphological structures. Moreover, the parameters of a branch were modified to correspond more closely to the constraints set out in the article of Kitaoka et al. [START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF] and more in accordance with the function of these airways, i.e. gas transport.

Generation of the bronchial tree

The algorithm that generates the medium and small airways of the model of the bronchial tree is based on two models from the literature. It combines the two approaches with new updated methods. We set up a hybrid model using the subdivision principles of Tawhai et al. algorithm [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF][START_REF] Merryn | CT-based geometry analysis and finite element models of the human and ovine bronchial tree[END_REF], while taking into account the rules developed by Kitaoka et al. [START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF] that ensure an optimal distribution of the flow in the tree in terms of viscous dissipation.

Rules for the generation of the bronchial tree

As in the two original algorithms, we propose a deterministic algorithm based on the repetition of a set of successive steps. The steps are the following :

1. Calculation of the barycentre and the center of the largest inscribed sphere, the pole of inaccessibility (PoI), for a closed surface mesh (Cf. 3.7b).

2. Definition of the initial direction of the branch, according to the reference point (barycentre or PoI) (Cf. 3.7c).

3. Computation of the morphological parameters of the branch (diameter, length and branching angle).

4. Check to determine if the branch is terminal. 8. Repeating the operation with all the new closed surface meshes (Cf. 3.7d).

Paramaters of the algorithm

Barycentre

The barycentre C of a volume is calculated from its surface mesh. It is defined by : with C i as the barycentre of the i-th face, A i as the area of the i-th face and p i j as the j-th node of the i-th face.

C = N f aces i 1 3 (p i 0 + p i 1 + p i 2 ) × 1 2 ∥(p i 1 -p i 0 ) ∧ (p i 2 -p i 0 )∥ N f aces i 1 2 ∥(p i 1 -p i 0 ) ∧ (p i 2 -p i 0 )∥ = N f aces i C i × A i N f aces i A i (3.7) (a) (b) (c) (d)
However, the volume could be non-convex. Then, the barycentre could be outside the mesh or too close to the edges of the surface mesh. In this case, we use another point called the pole of inaccessibility, which is always included in the volume.

Pole of Inaccessibility (PoI)

The pole of inaccessibility, noted PoI, of a volume is the center of the largest sphere included in this volume. We propose a method to compute the PoI of a closed surface mesh, based on a 2D algorithm. This 2D algorithm has been developed by V. Agafonkin, using objects called quadtrees [START_REF] Agafonkin | A new algorithm for finding a visual center of a polygon[END_REF]. The concept of quadtree is to subdivide, recursively, a two-dimensional space into four cells. Quadtrees are widely used for spatial indexing problems, image compression and physical simulation. We extended the 2D algorithm into 3D. The 3D objects that match quadtrees in 2D are called octrees. Octrees arise from the subdivision of a three-dimensional domain into eight cells. The algorithm works as follows on a closed surface mesh:

1. The bounding box of the mesh is generated and forms the initial cell.

2. The cell is divided into 8 cells by subdividing the box in 2 in each spatial directions.

3. For each cell, the signed distance, dist mesh , between the cell's barycentre and the mesh is calculated. It is positive if the barycentre is inside the mesh and negative if the barycentre is outside.

4. The cells are added to a queue list according to their potential, defined by potential = radius + dist mesh . The quantity radius is the half-diagonal of the cell.

5.

Steps (2), (3), and (4) are repeated for the next active cell, which is the cell next in the list that maximises the potential and whose size is larger than a given size threshold. The algorithm goes on until all the cells sizes are smaller than a threshold denoted H lim .

Branching angle

Next, we check that the branch orientation is correct, i.e. that the branching angle is in agreement with the morphometry of the lung. The branching angle is defined as the angle between the mother branch and the daughter branch. Using the branch direction, a branching angle can be calculated by applying the following formula :

θ init = arccos v mother • v init ||v mother || × ||v init || (3.11)
This value determines if an angle correction is needed. Actually, in most articles [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF][START_REF] Merryn | CT-based geometry analysis and finite element models of the human and ovine bronchial tree[END_REF][START_REF] Bordas | Development and Analysis of Patient-Based Complete Conducting Airways Models[END_REF][START_REF] Montesantos | The Creation and Statistical Evaluation of a Deterministic Model of the Human Bronchial Tree from HRCT Images[END_REF], an angle threshold is set and the angles above this threshold are adjusted to the value of the threshold. In the case of the algorithm of Tawhai et al., the threshold is set at 60°.

In our method, the threshold is only used to determine whether a branching angle should be corrected or not. The choice of value is done by studying the influence of this parameter combined with the decision ratio for the branch direction. We then found that the best possible combination was a decision ratio of r d = 0.95 combined with a branch angle threshold value set at 96°. Kitaoka et al. set this value at 80°, which does not fit exactly with our decision ratio. However, we do not correct the branching angle by adjusting it to the threshold value, but instead we use the theoretical branching angle described in Kitaoka et al.. This theoretical angle results from a network optimisation process [START_REF] Kamiya | Theoretical relationship between the optimal models of the vascular tree[END_REF]. Kitaoka et al. define the theoretical branching angle by:

θ theoric = arccos 1 + r 4/n -(1 -r) 4/n 2r 2/n (3.12)
with r = V child Vparent and n = 3. The variable n can vary according to the type of air flow in the branch. The flow in the branches of the bronchial tree is predominantly laminar, except in the large branches [START_REF] Medvedev | Three-Dimensional Model of the Human Bronchial TreeModeling of the Air Flow in Normal and Pathological Cases[END_REF]. If it is laminar then n = 3, but if the flow is turbulent n = 2, 33. In our algorithm, this coefficient depends on the generation of the branch, the first generation will use n = 2, 33 while the smaller branches will use n = 3.

Then, the initial branch is rotated around the vector normal to the plane generated by the initial branch and its mother branch. The purpose of the rotation is to adjust the branching angle to match the theoretical value θ theoric . The rotation is performed using a rotation matrix R:

R = P + cos(θ rot )(I -P ) + sin(θ rot )Q (3.13)
Where :

P =    u 2 x u x u y u x u z u x u y u 2 y u y u z u x u z u y u z u 2 z    ; I =    1 0 0 0 1 0 0 0 1    ; Q =    0 -u z u y u z 0 -u x -u y u x 0    (3.14) u = v mother ∧ v init (3.15)
where u is the normal vector of the initial branch and the mother branch. The rotation angle θ rot is θ rot = θ theoricθ init . To obtain the branch with the right branching angle, we apply the rotation matrix on the vector of the initial branch : v daughter = Rv init .

Length

Finally, the length of the branch is computed using the diameter of the branch, based on morphometric observations [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF][START_REF] Merryn | CT-based geometry analysis and finite element models of the human and ovine bronchial tree[END_REF] :

L D = 3 (3.16)
It is, however, more accurate to work with a distribution of this ratio instead of a single value. Our method aims at getting a normal distribution of expectation 3 and of standard deviation 1, as in the model proposed by Tawhai in [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF][START_REF] Merryn | CT-based geometry analysis and finite element models of the human and ovine bronchial tree[END_REF]. Tawhai et al. defined the length of the branch as being 40% of the length of the segment between the end of the mother branch and the barycentre of the associated volume.

We worked with the same principle, adding several modifications. We define a ray spanning from the vector directing the daughter branch. Then we calculate the intersection points between this ray and the surface mesh associated to the branch. There may be several points of intersection due to the fact that some surface meshes are non-convex. These points of intersection are then sorted according to their distance from the end of the mother branch. The length of the daughter branch is defined as being 25% of the length of the nearest point of intersection. After that, we check that the relationship between the length is more or less respected, i.e. if the ratio is less than 6, we will not correct the length of the branch.

Terminal branch

Once the morphometric parameters of the branch are computed, we need to determine whether the branch is terminal or not. In the articles of Tawhai et al. and Kitaoka et al., the generation of the bronchial tree stops at the level of the terminal bronchioles which serve the acinus around the 15th, 16th generation. We make our algorithm generate more branches to go down to the respiratory bronchioles, which serve the subacini and which appear near the 17th or 18th generation [START_REF] Bernard Sapoval | Smaller is better—but not too small: A physical scale for the design of the mammalian pulmonary acinus[END_REF]. For Tawhai et al., a branch is defined as terminal if its length is less than a threshold value, or if the volume served does not contain enough points. In the model of Kitaoka et al., if the estimated flow is too small then the branch is considered as terminal, a condition that is actually related to the diameter of the branch.

In our algorithm, we used a similar technic as Kitaoka et al. but using directly a diameter threshold d terminal . Indeed, we know the diameter of the trachea and we can deduce a theoretical diameter for the terminal branch. According to Weibel et al. [START_REF] Weibel | Fractal geometry: a design principle for living organisms[END_REF][START_REF] Ewald | Morphometry of the Human Lung[END_REF], the mean generation for a terminal branch is around 17, and the ratio between the diameter of the mother branch and the diameter of the daughter branch is ( 12 )

1 3 , so we have the following relation:

d terminal = d trachea 2 17 3
(3.17)

Definition of the cutting plane

In the papers of Tawhai et al. [START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF][START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF], two different versions of the definition of the cutting plane can be found. In both versions the plane is centered on the end of the branch. However, in the 2000 paper, the plane is defined using the branch and the mother branch, while in the 2003 paper, the plane is defined using the sister branch instead of the mother branch. More recently, models such as Bordas et al. [START_REF] Bordas | Development and Analysis of Patient-Based Complete Conducting Airways Models[END_REF] or Montesantos et al. [START_REF] Montesantos | The Creation and Statistical Evaluation of a Deterministic Model of the Human Bronchial Tree from HRCT Images[END_REF] have also based their work on the model of Tawhai et al. and, as Tawhai et al. did [START_REF] Merryn | CT-based geometry analysis and finite element models of the human and ovine bronchial tree[END_REF], they centered the plane on the barycentre of the volume and using the vector of the branch and its sister branch. In this work, we have used the same definition as the 2003 paper from Tawhai et al., then the cutting plane of a closed surface mesh is centered on the end point of the branch associated with this mesh, and defined using the direction vector of this branch and its sister branch. By opting for the point at the end of the branch, it is guaranteed that the daughter branches obtained afterwards will be associated with a mesh. If we had taken the barycentre, as can be seen in the Figure 3.8, the daughter branch will potentially have a length that can greatly exceed the length/diameter ratio fixed at 6, and if there is a need to redefine its direction, it may not even be defined in its associated mesh.

Mesh division

Tawhai et al. model generates an arbitrary grid of points at the beginning of the algorithm. This grid allows to approximate the volume where the tree can grow, but this method does not necessarily allow to keep a good precision throughout the growth. Instead, we divise the surface meshes with a plane to obtain two new closed surface meshes. To perform these operations, we use the mesh processing methods embedded in the CGAL library [START_REF]The CGAL Project[END_REF], The principle is to calculate the intersections between a plane and a line. For each edge of the mesh, the following method is applied:

• Calculation of the scalar product between the normal of plane and the line defined by the edge to know if the plane and the line are parallel :

(l 1 -l 0 ) • n (3.18)
With l 0 , l 1 the two points defining the edge and n, the normal of the plane. If the scalar product is zero then the plane and the line are parallel, otherwise they are not.

• If the plane and the line are parallel, we check if the line is contained in the plane or not, by using the following equation :

(p 0 -l 0 ) • n (3.19)
With p 0 , a point on the plane, l 0 , the first point on the edge and n, the normal vector of the plane. If the scalar product is zero then the line is contained in the plane, if it is non-zero then the line is not contained in the plane and there is no intersection.

• If the plane and the line are not parallel then there is an intersection point, we start by computing the next parameter :

d = (p 0 -l 0 ) • n (l 1 -l 0 ) • n (3.20)
Two cases can be distinguished :

-If d ∈ [0, 1]
then the intersection point is on the edge, and we define it by :

p = l 0 + (l 1 -l 0 ) • d (3.21) -If d / ∈ [0, 1]
then the intersection point isn't on the edge, and it is thus not necessary to make the calculation.

Once the various points of intersection have been calculated, these points are added to the mesh and the intersecting faces are remeshed. We obtain two new surface meshes which are, however, open. To close these meshes, the intersection polygon must be recovered and triangulated. To do this, we use an Ear Clipping method [START_REF] Eberly | Triangulation by Ear Clipping[END_REF], whose steps are defined by :

• Computation of the angle of each point of the polygon.

• Creation of the triangle, using the node whose angle is close to 90°and its preceding and following nodes.

• The node is removed from the polygon, and the connection and the angles of the preceding and following points are updated.

• The steps 2 and 3 are repeated until inly three points remain.

The result of the ear clipping is then reworked to improve it and added to the two new surface meshes. We thus have two closed surface meshes, which will be used for the rest of the calculations.

Modularity of the algorithm

We have presented the different steps and default parameters of our algorithm, however we explored different setups of our algorithm, as detailed in Table 3

Results

After various tests, we were able to define default parameters for our model. The cutting plane is centered on the end of the branch and defined by this same branch and its sister branch. As for the orientation direction of the branch, we use the method alternating between the barycentre and the PoI, depending on the signed distance of each from the mesh. If the signed distance of the barycentre is greater than the product of the decision with the signed distance of the PoI then we choose the barycentre, otherwise the PoI is taken into account. This ddecision ratio was estimated at 95% of the signed distance of PoI and allows a good distribution between the barycentre and PoI. We have about 51, 4% use of the barycentre and therefore 48, 6% use of the PoI. Then we activated the branching angle correction with a threshold limit of 96°. The algorithm was used on the surface meshes of the lobes extracted from the data of a patient from the LIDC-IDRI library during the LUNA16 challenge [START_REF] Arindra | Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: The LUNA16 challenge[END_REF] and from the annotations of Tang et al. [START_REF] Tang | Automatic Pulmonary Lobe Segmentation Using Deep Learning[END_REF]. The result is a mesh, as shown in Fig 3 .10, representing the model of the bronchial tree obtained. A statistical analysis was made on the whole tree and on each lobe. The averages are presented in the Table 3.2.

We have set up a "score" that gives us an idea of the accuracy of the models with respect to the branching angle and the reduction factor for major and minor branches. The objective is to bring the value of the "score" towards 0. The major branch is the daughter branch of a bifurcation that feeds the largest volume. The minor branch is the daughter branch of a bifurcation that supplies the smaller volume. This score is expressed with the following function: Morphometric data such as diameter or length are not present in the table 3.2. The average value of these parameters for the whole bronchial tree model is not worth analysing, as they do not give any information about the accurateness of our model. The ratio between length and diameter is also not present. The values are all very close, whatever the organ, with a mean ratio estimated at 3.08. This is due to the implementation of the model, which takes into account the volume of the closed surface mesh, and using this information deduces from the Eq 3.10 the value of the diameter of the branch. The length is then deduced from this diameter by ensuring that the ratio between these two is between 1 and 6. This is confirmed by looking at the Fig 3 .11b, 3.11a, 3.11c, which represent the average length, diameter and branch ratio for each generation of the bronchial tree. It can be seen that the slope of the length and diameter curves are quite similar with divergences on the first generations (dotted line), which are those extracted from the mesh. For the variations on the end of the branch (more transparent line), this is due to the smaller number of branches which can then make the generation average fluctuate more or less.

score = 1 3 ×   (θ -
For the branching angle, over the whole bronchial tree model, we have an average branching angle of 37.12°. Figure ?? represent the distribution of branching angles of the model where we observe a peak on the average branching angle. We observe for the angles from 0 °to 35 ° a higher concentration than for the angles between 40 °and 95 °but which finally compensates for these first angles because the interval is larger. This is due to the heterogeneity of the subdivision resulting from the hybrid method. Indeed, by using the pole of inaccessibility, the cutting plane separates the closed surface mesh in a more heterogeneous way. The theoretical branching angle is then different from 37.5°. This can also explain the discrepancies observed on the mean branching angles in the lobes. We can, for example, see that in the left lung, where the lobes are quite similar, the average angles have a difference of about 3°, while in the right lung where the volumes are more heterogeneous, the difference rises to 7°. Despite this, the branching angles harmonize to have an average of 36.70°in the right lung, which is not far from the desired theoretical value. mong the other statistics at our disposal, we have the asymmetry factor of our bronchial tree for each generation (see Figure 3.11f) and its average for each lobe (see Table 3.2). The asymmetry factor represents the diameter ratio between the minor and the major branches from a bifurcation. This is an important value to evaluate the asymmetry of our tree. In our case with the default parameters, we have an average for the lobes between 0.8 and 0.85 and for the whole bronchial tree 0.84. This value is quite close to the value observed by Weibel et al. who estimated this asymmetry factor at 0.86 [START_REF] Ewald | Morphometry of the Human Lung[END_REF]. If we now look at the curve without taking into account the first 3 generations and the last generation, we have values between 0.8 and 0.85. The variations observed are due to the greater or lesser use of the barycentre, which makes the ratio tends towards 1.

This effect is also observed on the diameter reduction factor. On average, this reduction factor is 0.78 for our model, which is quite close to the desired value for an asymmetric tree of 0.76 [START_REF] Mauroy | An optimal bronchial tree may be dangerous[END_REF]. The Figure 3.11e shows the average diameter reduction factor for each generation. It can be seen that from the 6th to the 27th generation, where the number of branches is significant, the average diameter reduction factor has a constant value around 0.78.

Finally, we observe in our model that the first terminal branches appear at the 9th generation and end at the 33rd generation. The average of these terminal branches is 16.61 generation which places us between the observations of Weibel et al. with 16 generations [START_REF] Ewald | Morphometry of the Human Lung[END_REF] and the observations of Horsfield et al. with 17.6 generations [START_REF] Horsfield | Morphology of the bronchial tree in man[END_REF]. The number of generations obtained may seem high, but in the last generations the number of branches generated is quite low and the impact on the rest of the tree is very small. These last branches are there to fill in the areas that are difficult to fill in, especially towards the part connected to the diaphragm.

Discussion

In this paper, we have developed an algorithm to generate a model of the bronchial tree, feeding a closed surface mesh. This mesh is the result of another part of my work, allowing to segment, from CT-Scan, the lung lobes and the first generations of the bronchial tree.

This algorithm is based on the work of Kitaoka et al. [START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF] and Tawhai et al. [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF]. Both algorithms produce space filling trees but differ in their basic principle. The first one aims to fit perfectly in the geometry where the tree will grow, while the second one optimises the flows in the branches. It was therefore important for us to combine these two algorithms, while updating the tools and calculation methods, since these two models were created two decades ago. We have, for example, used closed surface mesh, instead of a point grid for the subdivision of the space. The closed surface mesh allows to have a better quantification of the volume associated with each branch. Kitaoka et al. defined equations to calculate morphometric data (diameter and branch angle) which we applied to the branches. We have also introduced some new features, such as the shift from the barycentre to the pole of inaccessibility (PoI)for building a branch. This ensures that in non-convex regions of the mesh, the branch always fits into the mesh. The algorithm also adapts according to the generation of a branch, indeed between the beginning and the end of the bronchial tree, the type of airflow is not the same. In the first generations the flow is turbulent and will progressively evolve towards a laminar flow in the smaller branches. This evolution of the flow has an impact on the optimal branching angles and on the diameter.

Since our algorithm is based on these two other algorithms, it is important to verify that the resulting model of the bronchial tree is in line with the results observed with the versions of Tawhai et al. and Kitaoka et al.. It is also important to confront the model with the observations of Weibel et al. [START_REF] Weibel | Fractal geometry: a design principle for living organisms[END_REF][START_REF] Ewald | Morphometry of the Human Lung[END_REF] or Horsfield et al. [START_REF] Horsfield | Computer simulation of the geometry of the human bronchial tree[END_REF][START_REF] Horsfield | Diameter, length and branching ratios in the bronchial tree[END_REF][START_REF] Horsfield | Models of the human bronchial tree[END_REF][START_REF] Horsfield | Morphology of branching trees related to entropy[END_REF][START_REF] Horsfield | Morphology of the bronchial tree in man[END_REF]. We will also compare the model with the models of Montesantos et al. [START_REF] Montesantos | The Creation and Statistical Evaluation of a Deterministic Model of the Human Bronchial Tree from HRCT Images[END_REF] and Bordas et al. [START_REF] Bordas | Development and Analysis of Patient-Based Complete Conducting Airways Models[END_REF], based on The morphometric data of the Table 3.3 show that our model fits the expectations. Indeed, the average branching angle is 37.12°, which is close to the ideal branching angle calculated by Horsfield et al. [START_REF] Horsfield | Morphology of the bronchial tree in man[END_REF], but also close to the results of Tawhai et al. [START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF].

By observing the ratio between the length and the diameter of the branches, the same consistency can be observed as for the branching angle. Our model has a global average of 3.09, which is close to the value of Kitaoka's model at 3.06 [START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF] or to the observation made by Weibel et al. [START_REF] Ewald | Morphometry of the Human Lung[END_REF] The observation is the same for the diameter reduction factor between a daughter branch and a mother branch, which has been estimated by Weibel et less well with 0.82, which is still very close to the observations. To go further, we studied the reduction factor between the minor branch (daughter branch with the smallest diameter of the bifurcation) and the mother branch as well as the major branch (daughter branch with the largest diameter of the bifurcation) and the mother branch. We have, respectively, 0. As said before, the algorithm is also very flexible, with the possibility of choosing from various parameters, in particular the center or the second branch of the cutting plane, and the point towards which the daughter branch is pointed. There is also the possibility of applying or not the correction of the angle for the branches or even the value of the stop criterion. In this section we will present different models that were all generated on the same patient data, with the angle correction, but with different generation parameters. All the statistics on the generated bronchial trees are in the appendices, we will discuss here the differences between the models. We generated several trees with different parameters for the center of the cutting plane, the second vector used for the cutting plane and the choice of the point for the branch orientation. The Table 3.4 gathers some important statistical data such as the "score" (Cf. Equation 3.22) in order to determine the model that comes the closest to our requirements for asymmetry and branching angle. Several remarks can be made about the influence of parameters such as the cutting plane or the orientation of the branch. First, in relation to the center of the cutting plane, its impact is stronger on the asymmetry of the tree and the number of generations. For the cutting plane centered on the barycentre, whatever the other parameters, the resulting model of the bronchial trees have an asymmetry of 0.97, terminal branches between the 12-th and the 16-th generation with an average generation of about 14.83. The same observation can be made for the trees whose plane is centered on the PoI. The asymmetry is stronger with values between 0.84 and 0.86, terminal branches appearing from the 9-th generation to the 30-th generation. The average generation of the terminal branches fluctuates little with a minimum of 16.01 generation and a maximum of 16.49 generation. We can also see a difference in a particular case, when the branch is oriented towards the barycentre. In this case, we observe a difference between the average branch angles obtained with the plane centered on the barycentre and with the plane centered on the PoI. For the first version the branching angle is about 43°and for the second we have a branching angle of about 39.28°. When the cutting plane is centered on the end of the branch it is largely influenced by the orientation of the branch, if the branch is oriented towards the barycentre the results are similar to those for the cutting plane centered on the barycentre and the same are true for PoI. Some differences, however, can be explained by the fact that when the orientation of the branch is corrected, the center of the cutting plane is moved.

For the choice of the vector defining the cutting plane, we can see that it has, depending on the case, an influence on the average branching angle of the generated tree. When the branch is oriented on the barycentre, there is almost no difference between the trees obtained with a cutting plane defined by the mother or sister branch. The branch angles are very close regardless of the vector used. In the case where the branch is oriented towards the PoI or with the hybrid method, we can observe a difference of 4°between the two vector choices. With the plane defined by the parent branch, the average branching angles are quite low, with values around 33°. With the plane defined by the sister branch, these average branch angles are around 37°, which is more in agreement with the theoretical value of 37.28°of Horsfield et al. [START_REF] Horsfield | Morphology of the bronchial tree in man[END_REF].

When it comes to the choice of branch orientation, we can observe that the barycentre differs, from the two other choices (the PoI or the hybrid method) which often have quite similar results. The effects of this choice are mainly localized on the branching angle. The trees whose branches are directed towards the barycentre have a higher average branching angle than the other two methods, with a difference of up to 10°. This is the case for the methods using a cutting plane centered on the barycentre and defined with the mother branch, the branch angle is 42.68°for the method directed towards the barycentre whereas for the two other choices, the average branch angle is between 32.65°and 33.22°. When the cutting plane is centered on the end of the branch, the choice of the orientation of the branches has a greater impact. This choise influences the result of the asymmetry with values close to 1 when the branch is oriented towards the barycentre. The values are more in line with the observations of Weibel et al. [START_REF] Ewald | Morphometry of the Human Lung[END_REF] and Phalen et al. [START_REF] Robert | Application of an idealized model to morphometry of the mammalian tracheobronchial tree[END_REF] who measure this asymmetry at 0.86. This is confirmed by the generation of the terminal branches where the gap between the beginning and the end is more condensed in the case of the barycentre, resulting in an average generation close to 15, which is a little low.

The model using the cutting plane centered on the end of the branch, defined with the sister branch and using the hybrid method with a decision ratio of 0.95 for the branch orientation has the best "score" with a result of 0.0072.

As explained, some data are present in the table, are not relevant to show the differences between the methods. This is the case for morphological data such as length and diameter. For the ratio between the length and the diameter, whatever the model used (see table in appendix), the values are always quite similar, with 3.1.

Conclusion

We presented an algorithm that generates models of the bronchial tree. The algorithm combines the benefits of the respective algorithms of Kitaoka et al. and Tawhai et al. while introducing new methods to improve the accuracy and speed of calculations. The model generated agrees with morphometric data, such as an average branching angle close to 37.28°o r a length to diameter ratio equal to 3. The diameter of each branch is calculated so that the flow distribution in the bifurcations and the bifurcations branching angles minimize the viscous dissipation. The choice of the barycentre or pole of inaccessibility according to their signed distance from the closed surface mesh allows a better filling of the lung, especially in the non-convex zones of the lung. Using the PySkelton python package [START_REF] Fuentes Suárez | Scaffolding skeletons using spherical Voronoi diagrams: Feasibility, regularity and symmetry[END_REF][START_REF]aj-fuentes/PySkelton: Modeling with Scaffolding and Anisotropic Convolution surfaces[END_REF], we can generate a mesh completely usable for numerical simulations.

Annexe

In this section, we present a large number of results obtained with different methods, since our algorithm is scalable. We will revisit our procedure to determine which model converged better to the morphometric data. We will also be able to highlight the advantage brought by the branching angle correction algorithm.

Influence of the parameters

In the discussion we have already discussed the influence of certain parameters such as the center and the second vector of the cutting plane or the choice of the point for the orientation of the branch. In this section we look at other parameters such as the use of the branch angle correction, the threshold of the branch angle at which the angle correction is applied. We come back to the choice of the decision ratio of our hybrid method for the direction of the branch. This also allows to see how the default parameters were selected.

Influence of the branching angle correction

The correction of the branching angle is an important point in the algorithm. It allows to correct the branching angles when it is larger than a threshold value. In the models studied, this threshold value is 96°, and we explain in the following how this value was selected. The Table 3.5 groups the results for different models of bronchial trees with and without the branch angle correction.

It is on the average branch angle that the branch angle correction has an impact. The data of the bronchial trees presented in the table are unequivocal, when the branch angle correction is not applied we have average branch angles all greater than 49°, whereas with the angle correction, the greatest average branch angle is almost 44°. The biggest difference is on the algorithm whose plan is centered on the end of the branch and using the sister branch to be defined, and the branch is directed to the PoI. For this algorithm the branch angle correction allows to go from an average of 54.38°to an average of 36.81°.

On the algorithms whose branches are oriented towards the barycentre, the effects of the correction are less important. The differences between the average branch angles with and without correction vary between 7°to 11°For algorithms where the cutting plane is centered on PoI, the branching angular means go down from approximately 7°to 11°For the others algorithms, with the branches oriented towards the PoI or with the hybrid method, the reduction of the angle is at least 14°. The correction of the branching angle allows to approach the theoretical value of 37.28°.

The branch angle correction allows to have a more restricted distribution of branch angles with a smaller standard deviation. For the other parameters, such as the generation of terminal branches or the asymmetry, the angle correction has little influence. Especially when the cutting plane is centered on the barycentre or on the PoI. This results from the fact that the subdivision of the closed surface mesh is not influenced, for these algorithms, by the branch angle correction. For bronchial trees where the cutting plane is centered on the end of the branch, there is a slight increase in the average generation of terminal branches, and also a moderately higher asymmetry.

The branch angle correction has some influence on the length of the branches but not on the diameter. The average lengths recorded when using the branch angle correction are lower than without it, which also results in a lower average length to diameter ratio. This slight discrepancy between the lengths is due to the fact that the length depends on the distance between the start and the first intersection of the ray of this branch with the mesh. Changing the branch angle changes this distance and therefore the length of the branch. The diameter does not change because its calculation depends on the volume associated with the branch which is not necessarily influenced by the branch angle correction.

Influence of the threshold branching angle

In the previous section, we discussed the branch angle correction, and explained that the algorithms presented applied this correction when the branch angle exceeded a threshold, set at 96°. In this section, we will show the effects of this threshold on the bronchial tree and how we determine the default angle. In the papers by Kitaoka and Tawhai, threshold values were set at 80°and 60°respectively. The Table 3.6 shows the results for both angles. The table contains morphometric data that can be influenced by the threshold branch angle. Starting with the terminal branches, it can be seen that the boundary branch angle has no influence on algorithms with a cutting plane centered on the barycentre or the PoI. Since the center of the plane is not influenced by the branching angle correction, it is quite consistent that this has no influence on the appearance of terminal branches. For algorithms whose cutting plane is centered on the barycentre, the average generation of terminal branches is 14.8, and for those centered on the PoI, the average generation of terminal branches is 16.3. This is not the case when the plane is centered on the end of the branch. As the branch changes orientation, the center of the cutting plane will also change. As the threshold branch angle increases, the average generation of terminal branches decreases, for example for the default algorithm, from 17.93 generation on average for the 60°angle to 16.69 generation for 96°. The branching angle correction causes a modification of the volumes of the subdivided surface meshes and therefore of the diameters of the branches. The minor branch will then have a smaller diameter and the major branch a larger diameter. This hypothesis is confirmed at the asymmetry, which compares the diameter of the minor branch to the major diameter, whose values increase when the threshold angle increases. This increase means that the diameters tend to become uniform towards the same value. This can be observed with the default algorithm where the asymmetry is 0.79 when the threshold branch angle is at 60°, and increases to 0.82 when the threshold angle is at 96°. Paths where branches have a larger diameter are longer to reach a terminal branch, so that when the threshold branch angle is smaller, the maximum generation of terminal branches is greater.

It is observed that the effects are greater when moving from 60 to 80 than when moving from 80 to 96. We can even see that the different data tend towards the values observed when the angle correction is not applied, based on the Table 3

.13 represents the evolution of the average generation of the terminal branches, the average ratio length/diameter of the branches of the tree, the average branch angle and the asymmetry as a function of the threshold value for the branch angle correction. In each graph, the dotted line represents the values obtained when the correction is not applied. In each case, as the branch angle increases, the curve converges to the value observed when the correction is not applied. This means that the lower the threshold value of the correction, the higher the number of corrected branches and vice versa. The average generation of the terminal branches is 18.27 when the threshold branch angle is fixed at 50°to decrease progressively to 16.06 generation for a threshold value of 180°.

For the average ratio of length to diameter, it will increase from 2.84 to 3.42. It can then be assumed that the threshold branch angle seems to influence the length and/or diameter of the branches.

The branching angle has a curve quite similar to the ratio lenght/diameter with an increase. Dmajor . The dotted black line represents the mean of each morphological parameter when the bronchial tree correction is not activated.

When the threshold branch angle is 50°, the average branch angle is 26.22°. When the threshold value reaches 180°, we have an average branch angle of 54.14°.

Finally, the model of bronchial tree becomes more and more symmetrical as the threshold branch angle increases.

Influence of the decision ratio of hybrid method

We have introduced a new way of defining the direction of a branch. This method allows to choose between the barycentre and the PoI based on the signed distances with the associated surface mesh. We know that the PoI is the center of the largest sphere inscribed in the volume and that, necessarily, this PoI is the point with the largest signed distance. The barycentre is not necessarily inside the volume, especially when the volume is non-convex. To choose between the PoI and the barycentre, we compare the signed distance of the barycentre with the product of the decision ratio r d and the signed distance of the PoI. If the signed distance of the barycentre is greater than this product then the branch is oriented towards the barycentre, otherwise the PoI is used.

To determine this decision ratio, we made several tests on our default model, i.e. with a cutting plane centered on the end of the branch and defined with the sister branch. And of course this model uses our hybrid method for the branch direction. The branch angle correction is activated with the threshold branch angle 96°. The Table 3.7 shows the different results.

For the terminal branches, the range of appearance increases as the decision ratio increases. Thus, the average generation of these terminal branches also increases from 14.93 for r d = 0 to 16.69 for r d = 1. For the branching angle, it is quite different, there is a slight growth with some variations between r d = 0 and r d = 0.5 passing then from 43.96°to 44.06°. Then, we observe a decrease to get an angle of 36.80°when r d = 1. For the assymetry the value is quite constant between r d = 0 and r d = 0.65 with an average of 0.96 and then decreases to 0.82 when r d = 1.

During this study, we measured the number of times during the generation that the barycentre was chosen as the direction when creating a branch and similarly for the PoI. This allowed us to calculate a percentage of use of the barycentre, which can be found in the Table 3.7. By observing the percentage of barycentre used by the model for the orientation of the branch, we can understand why the data does not vary much for r d < 0.65. The percentage of use of the barycentre is always 98.21%, drop to 51.40% at r d = 0.95 and 0% for r d = 0.

Comparing the Table 3.7 with the Table 3.4 shows that when the decision ratio is equal to 0, the resulting tree seems like the one using only the barycentre. The average generation of the terminal branches is 14.90 for the hybrid model with r d = 0, and 14.92 for the version with the barycentre. For the asymmetry, there is no difference between the two models with 0.96. There is a slight difference for the average branch angle with 43.96°for the hybrid model and 43.86°for the barycentre model. The same observation can be made between the hybrid model with a decision ratio of 1 and the PoI-oriented model.

Selection of parameters for the hybrid method

We have set up a method to choose between the barycentre and the PoI for defining the direction of the branches. This method is combined with an angle correction, with a plane centered on the end of the branch and defined with the sister branch. In the previous sections, we have shown, independently, the influence of the threshold branch angle and the decision ratio for the hybrid method. In this part, we show how we could best choose the values of these parameters to have a model as close as possible to the observations. To check whether a model is performing well, we defined a performance "score" (see Equation 3.22) which measures the closeness of some average values of the generated bronchial tree to the observations. The data we evaluate are the branching angle and the reduction factors of the minor and major daughter branches. The optimal values are 37.28°for the branch angle, 0.7083 for the diameter reduction factor of the minor daughter branch and 0.8638 for the reduction factor of the major daughter branch.

For that, we first generated several trees with parameters of the threshold branching angle going from 50°to 120°with a step of 10°and a decision ratio going from 0 to 1 with a step of 0.05. The Figure 3.14 is a 2D representation of the performance "score" of the different models. The closer the value of the "score" of a model is to 0, the closer this model is to the observations for the branching angle, and the reduction factor for major and minor branches With the first graph of the Figure 3.14, we can see that the lowest "scores" are when the decision ratio is between 0.9 and 1 and the threshold branching angle is between 90°and 100°. The values of the "score" in this data set range from 0.026 at the maximum and 0.012 at the minimum.

We refined this data set by generating bronchial trees with a decision ratio ranging from 0.95 to 1 with a step of 0.01 and a threshold branching angle ranging from 95°to 100°with a step of 1°. The resulting "score" obtained are represented in the second graph of the Figure 3.14. With these various parameters, we obtain scores lower than 0.01 within a zone where the ratio is in the interval [0.95, 0.97] and the threshold branching angle in the interval [96°, 97°]. The lowest "score" value is 0.0072 for r d = 0.95 and θ limit = 96°. These parameters are then the default parameters of our model.

3.8.3

Introduction

In the introduction, we mentioned a phenomenon that develops with immersion in an aquatic environment, the diving response. This mechanism is a response of the human body that preserves its physical integrity but also that to prolongs the time spent underwater. The immersion reflex is not a phenomenon specific to humans but to all mammals. This response has been observed in dolphins, seals, etc., and consists in two responses. The first response is a bradycardia and it occurs as soon as the face comes into contact with water and can lead to a drop in heart rate of up to 50% depending on the individual [START_REF] Schagatay | Diving response and apneic time in humans[END_REF]. In seals, this bradycardia is even more significant, with measurements of up to a 90% drop [START_REF] Thornton | Oxygen and the diving seal[END_REF]. This bradycardia reduces the energy consumption of cardiac muscles but also counterbalances the hypertension induced by the second response, a peripheral vasoconstriction. This vasoconstriction closes the capillaries in the extremities and stops the blood flow in these areas. The blood flow is then centralised to the heart and brain to keep a sufficient supply of oxygen. The immersion reflex intensifies as the water temperature drops, so the heart rate will continue to drop and vasoconstriction will spread to the feet and hands, eventually affecting circulation in the legs and arms. With depth, the hydrostatic pressure exerts a significant pressure on the thorax, and the lungs will then decrease in volume (Boyle's law). Another immersion response is triggered by redistributing part of the blood volume from the extremities to the lung. At some point, this redistribution compensates for the loss of gas volume and creates a rigid hydraulic "frame" to limit lung collapse.

The aim of this section is to highlight this protection provided by the vascular system by studying the compression of the lung under the influence of high hydrostatic pressure. To do this, we will use the work previously presented in the previous sections combined with numerical simulations by finite elements (deal.II).

Depth Prediction

The lungs always contain a certain volume of air, the residual volume (RV). This is a nonmobilisable volume, which prevents the alveoli from collapsing, and so in early depth limit calculations the residual volume was considered as the limiting value. To determine the maximum depth theoretically attainable by a breath hold diver without compromising physical integrity, Boyle's law was used: P V = constant with P the air pressure and V the air volume. Assuming that during the dive the athlete closes the mouth, the respiratory system is then a closed system, which allows us to have the following relationship between the initial state (at the surface) and the final state (at maximum depth):

p init V init = p depth V depth (4.1)
In this formula, the pressures are the hydrostatic pressures acting on the body and the volumes are those of the air contained in the respiratory system. At the surface, the pressure p init = p atm = 1 atm and the volume of air is the sum of the residual volume and the maximum volume that can be inspired by the athlete, this volume corresponds to the total lung capacity (TLC), which varies according to each individual. With depth, the hydrostatic pressure increases and the volume will consequently decrease until, as we explained, it reaches the residual volume, which also varies for each person. Based on the two volumes and the initial pressure, we can then determine a first maximum depth that can be safely reached for each person with :

p depth = p atm × V T LC V RV (4.2)
Having less air volume than the residual volume can lead to lung collapse. For a standard, non-athletic person, the total lung capacity is about 6.54 L and the residual volume is about 1.73 L [START_REF] Brown | Airway Distensibility in Adults with Asthma and Healthy Adults, Measured by Forced Oscillation Technique[END_REF]. This person would then tolerate a maximum hydrostatic pressure of 3.78 atm, which corresponds to a depth of 27.80 msw. Based on the results of Lindholm et al. [START_REF] Lindholm | Studies on inspiratory and expiratory glossopharyngeal breathing in breath-hold divers employing magnetic resonance imaging and spirometry[END_REF], who studied the residual volumes and total lung capacities of 5 different breath hold divers using spirometry and MRI, breath hold divers have an average TLC of 9.59 L and a RV of 1.79 L. Using these values, they would tolerate a maximum pressure of 5.36 atm, which gives a depth of 43.57 msw.

Athletes can increase their air volumes by using two techniques. The first is "Lung Packing", which stores air in the upper respiratory system and increase the TLC, it can provide up to 2 L of extra air. In their work, Lindholm et al. measured a TLC of 11.49 L with "Lung Packing". With this technique, the maximum pressure shifts to 6.41 atm, which represents about 10 more meters than without "Lung Packing". There is also a second technique to reduce the residual volume, called "Reverse Packing". It consists in sucking the air from the lungs when they are "empty". With this method, and still according to Lindholm et al., the average residual volume would then drop to 1.41 L and would allow to reach a depth of 71.49 msw.

We are still far from the various records observed during freediving competitions with, in the case of the no limit, depths exceeding 200 msw. As we explained, the system reacts by redirecting some blood into the lung. This phenomenon known as "Blood Shift" allows for a considerable increase in performance. This blood volume V BS compensates the loss in air volume below the residul volume, so the Eq. 4.2 becomes :

p depth = p atm × V T LC V RV -V BS (4.3)
Jacques Mayol, a leading figure in freediving, was the first diver to exceed 100 m in depth (1976). Schaefer et al. [START_REF] Schaefer | Pulmonary and circulatory adjustments determining the limits of depths in breathhold diving[END_REF] had the opportunity to access data on the lung volumes of Jacques Mayol who, at the time, had a total lung capacity of 7.22 L and a residual volume of 1.88 L. Theoretically with the Eq. 4.2, it would only allow him to descend to a depth of 28 msw. Nevertheless, at the time of the publication of Schaefer et al., Jacques Mayol had just passed the 70 msw depth mark, and in their paper, they estimated that the blood shift had provided the lung with an input of 980 mL.

However, these models remain theoretical and none of them could really be observed under real conditions due to the extreme complexity of the environment and performance. Thus, with the results of our previous sections, we have meshes of the lungs that can be used to mimic diving with numerical simulations. In the remainder of this chapter, we will present a predictive blood shift model to study the compression of the lungs during a breath-hold diving.

Model of blood shift prediction

In the introduction, we presented a first model (see Eq 4.3) [START_REF] Schaefer | Pulmonary and circulatory adjustments determining the limits of depths in breathhold diving[END_REF], to predict the blood volume supply needed to reach a certain depth as a function of the total lung capacity and residual volume of a person. During descent, the lungs are subjected to the hydrostatic pressure of water, denoted p w . This hydrostatic pressure is not completely transmitted to the air in the lungs, some of it is compensated by the mechanical pressure of the lung tissue, noted p t . The lung tissue mechanical pressure is small compared to the hydrostatic pressure, so we identified two cases, one case without the tissue mechanical pressure and another with the tissue mechanical pressure.

Neglecting tissue mechanical pressure (p t << p w )

Model First, we assume that the blood shift occurs from a threshold value of the lung volume, which we note V c l . Thus, as long as the lung volume, noted V l , is higher than this critical value, the "Blood Shift" is not active, and then the blood volume induced by this phenomenon, noted V b , is null. When the lung volume is lower than this value, the Blood Shift compensates the additional air volume deficit with blood. This can be defined as :

V b =    0, if V l ≥ V c l V c l -V l , if V l < V c l
Moreover, the lung volume does not depend only on the volume of air contained in the lungs, noted V a , but also on the volume of the pulmonary tissues, noted V t . Thus, the lung volume is expressed as :

V l = V a + V t (4.4)
Then the total lung capacity (TLC), the functional residual capacity (FRC), the residual volume (RV) and the critical pulmonary volume (V c ) are, respectively :

V l,tlc = V a,tlc + V t ; V l,frc = V a,frc + V t ; V l,rv = V a,rv + V t ; V c l = V c a + V t (4.5)
Note that the volume of lung tissue is to be uncompressible and constant, his value is defined as a fraction α of the functional residual capacity of the lung (V l,frc ), i.e. V t = αV l,frc with α = 0.1 [START_REF] Ewald | Morphometry of the Human Lung[END_REF]. We can then apply the Boyle-Mariotte's law to the air volume V a :

V a p a = V a,tlc p atm ⇔ V a = V a,tlc p atm p a (4.6)
Where p a is the pressure of the air in the lung, V a,tlc is the air volume at the total lung capacity and p atm = 1 atm is the pressure of the air at the sea level. Since we neglect the tissue mechanical pressure, the air pressure equals the hydrostatic pressure p w of the water, so we have :

p a = p w = p atm + ρ w gz (4.7)
With p w the hydrostatic pressure of the water, ρ w the density of water, g = 9.81m.s -2 the acceleration of gravity and z the depth. With the previous relations, we can define z c the critical depth at which the critical volume of the lung is reached. Using the equation 4.7, we have :

p c a = V a,tlc p atm V c a (4.8)
With the equation 4.6, we have z c = p c a -patm ρwg and then :

z c = V l,tlc -V c l V c l -V t p atm ρ w g (4.9)
Then :

V a (z) = V l,tlc -V t p atm + ρ w gz p atm p a (z) = p atm + ρ w gz V b =    0, if z < z c V c l -V t -V a (z), if z ≥ z c (4.10)
In the Results section, the curves of different cases, including Jacques Mayol, are shown. The Equation 4.9 are similar to the Equation 4.2. They are adapted to the data we have with the meshes.

Results

The different variables of the equation 4.10 are either known or deduced. The atmospheric pressure is p atm = 1 atm = 101325 Pa, the density of seawater is ρ w = 1030 kg.m -3 and the acceleration of gravity is g = 9.81 m.s -2 .

For the other parameters, we will deduce them using different relationships, starting with the relationship between the air volumes at total lung capacity and functional residual capacity. According to [START_REF] Brown | Airway Distensibility in Adults with Asthma and Healthy Adults, Measured by Forced Oscillation Technique[END_REF], we approximate V a,frc = 0.508 V a,tlc , and following [START_REF] Ewald | Morphometry of the Human Lung[END_REF], we have V t = 0.1 V l,frc . By combining these two relations with the Equation 4.4, we then have V l,frc = 0.508 V l,tlc 0.9

. We then grouped the different volumes for an average person, an average breathhold diver as well as the case of Jacques Mayol in the Table 4.1.

Using the Equation 4.9 and the Table 4.1, we find a critical depth z c , at which the blood shift occurs, of 27.86 msw for the average person, extremely close to the critical depth observed for Jacques Mayol, with 28.49 msw. For athletes, we worked on the two cases : when they do not use the Lung Packing and Reverse Packing methods, and with the use of these two methods. In the first case, the "blood shift" initiates after 43.71 msw and for the second case after 71.71 msw

The Figure 4.1 shows the decrease of the air volume during breath-hold diving to the maximum depth recorded to date, 214 msw. The critical depth for each study case is also shown with the vertical dotted lines. It can be seen that the volume decreases, which is not at all surprising, given the Boyle-Mariotte's law. Furthermore, the intersection between the air volume curve and the critical depth represents the residual air volume.

The blood volume, induced by the blood shift, is represented in the Figure 4.1, which shows the development of the blood shift for the different cases. The volumes of an average person and of Jacques Mayol are similar up to the beginning of the blood shift. And after 40 msw, the growth of the curve of an average person collapses more than that of Jacques Mayol.

Volume

Average Person [START_REF] Brown | Airway Distensibility in Adults with Asthma and Healthy Adults, Measured by Forced Oscillation Technique[END_REF] Jacques Mayol [START_REF] Schaefer | Pulmonary and circulatory adjustments determining the limits of depths in breathhold diving[END_REF] Athlete [START_REF] Lindholm | Studies on inspiratory and expiratory glossopharyngeal breathing in breath-hold divers employing magnetic resonance imaging and spirometry[END_REF] Air Volumes The tissue mechanical pressure is a constant after z c because the volume of the lung no longer varies. The lung tissues are then not more deformed and their mechanical pressure becomes constant. Using 3D numerical simulations, we will calculate the mean tissue pressure p t as a function of the pressure p. And the lung volumes V l as a function of the tissue pressure p t . And so we will be able to deduce the variables and to evaluate more precisely the effect of the "Blood Shift".

V a,tlc 6

Modelling the compression of the lungs during breath-hold dive

To model lung compression, we studied the static deformation of the lung, considered as a homogeneous linear elastic material [START_REF] Brunengo | Optimal efficiency of high-frequency chest wall oscillations and links with resistance and compliance in a model of the lung[END_REF][START_REF] Berger | A poroelastic model coupled to a fluid network with applications in lung modelling[END_REF][START_REF] Pozin | A tree-parenchyma coupled model for lung ventilation simulation[END_REF][START_REF] Werner | Patient-specific finite element modeling of respiratory lung motion using 4D CT image data[END_REF]. We consider that, during diving, the lung is always in static equilibrium. The displacement of lung tissue at a location x ∈ Ω is represented by the variable u(x) ∈ R 3 and verifies :

div(σ(u)) = 0 in Ω Where σ(u) is the stress tensor describing the local stress of a material as a function of the displacement u. On the boundary, noted ∂Ω of Ω, we apply a uniform pressure p, i.e. we apply a Neumann condition, which expressed as :

σ(u) • n = -p • n on ∂Ω
The following system of equations can then be defined to represent the compression of the lung tissue:

   -div(σ(u)) = f (x, t) in Ω σ(u) • n = p • n on ∂Ω (4.15)
The development of numerical simulation with finite elements can be found in the appendix of this chapter. We have used the deal.II [START_REF] Arndt | The \textttdeal.II Library, Version 9.4[END_REF] library for solving the model equations.

Results

We calculated the solution when the pressure is equal to 1 Pa. From the solution obtained, given that the system is linear in the external applied pressure, we can deduce the solution for any pressure, by applying the equation 4.28. This model remains a linear model, and we are aware that the results obtained represent deformations that are too large. They are extrapolations, allowing us to have a tendency on the variations of the volumes and pressures during a breath-hold dive.

We calculated the lung displacement in 10 Pa steps up to a maximum applied pressure of 3530 Pa. We stop the computation at 3530 Pa because it corresponds to 300 msw The solution for each pressure step is stored in a VTK file, where the displacement is saved as three scalar fields representing the displacement in x (x_disp), in y (y_disp) and in z (z_disp). Each component of these vectors is associated with a vertex of the mesh. To estimate the tissue pressure depending on the compression when applying a pressure p, we compute :

p t = 1 |Ω| Ω 1 3 × Tr(∇u(x, y, z))dxdydz (4.16)
To estimate the volume of the mesh depending on the compression, we compute :

v l (p) = Ω |det(I + ∇u(x, y, z))|dxdydz (4.17)
To do this, we developed a Julia code to collect data from the VTK to calculate the tissue pressure and the lung volume.

The mesh used for this calculation is a mesh generated from the LUNA16 database [START_REF] Arindra | Validation, comparison, and combination of algorithms for automatic detection of pulmonary nodules in computed tomography images: The LUNA16 challenge[END_REF], and the segmentation was obtained with the model we presented in the chapter on lung lobe segmentation. The CT-Scan used was taken when the patient was at total lung capacity, which was measured at 6.5 L. As we do in the previous section, we can deduce the other important volumes from the total lung capacity. The volumes are grouped in the In the current case, with a Neumann condition applied on all the boundary, the applied pressure p is equal to the tissue pressure p t until the critical pressure z c is reached. After the critical point, the lung volume is constant. The air volume continues to decrease but the blood volume compensates for the loss. When the critical depth is reached, the lung tissue no longer undergoes deformation and its pressure remains constant. This can be seen in the Figure 4

.2.
With the values of the Table 4.2 and using the Equation 4.9 linked to the model without the pressure of the tissues, the critical depth is z c = 30 msw, and we can observe in our results where the pressure is not neglected that we are very close to this value with a critical depth measured at 30.09 msw for p = 2125 Pa.

The Figure 4.3 shows the curves for air (red) and blood (blue) volumes and air pressure (green) as a function of depth. These curves are for the model where tissue pressure is taken into account. If one were to plot the model curves without the lung tissue pressure, the difference is small and the curves would be superimposed. This is quite logical since the pressure applied is much lower than the hydrostatic pressure of water and therefore its impact on the volumes is also small. However, these simulations assume that the pressure is uniform throughout the lungs, but in the body, the lungs are contained within the rib cage, which has a greater resistance to compression. We generated new models taking into account the ribs, by applying a Dirichlet condition on the faces of the lung mesh that are close to the mesh of the ribs.

Accounting for tissue mechanical pressure and ribs

In the previous development, we assumed that the pressure applies homogeneously over the entire lung surface. Actually, the lungs are contained in the rib cage. The ribs are bones whose resistance to hydrostatic pressure is greater, which implies that their displacement during breath-hold diving is far smaller than the displacement of the lung. We assume that the ribs do not influence the air volume and blood volume calculations. The equations remain the same as 4.13.

Modelling the compression of the lungs during breath-hold dive

We modified the equation 4.

      -div(σ(u)) = 0 in Ω σ(u) • n = -p • n on Γ 1 u = 0 on Γ 2 (4.18)
Adding the ribs localisation

To obtain the mesh of the ribs, we used the 3D Slicer software [START_REF] Kikinis | 3D Slicer: A Platform for Subject-Specific Image Analysis, Visualization, and Clinical Support[END_REF]. We start by applying a thresholding on the CT-Scans to obtain a segmentation of the different bone parts present on the CT-Scans. The Figure 4.4a shows a strong presence of noise, which is removed by keeping only the connected components. The resulting mesh represents the entire rib cage with the sternum, spine and ribs. To obtain only the ribs, we have cut out the parts of the mesh representing the sternum and the spine in order to keep only the ribs. For breath-hold divers, the sternum is very flexible due to their training [START_REF] Carey | Effect of Skin Diving on Lung Volumes[END_REF][START_REF] Gaultier | Effects of nutrition, growth hormone disturbances, training, altitude and sleep on lung volumes[END_REF]. It does not offer as much resistance as the ribs. We therefore felt that it was not necessary to include it in the model at this time. Finally, we have developed a Julia code that allows to load the volumetric mesh of the lungs and the rib surface mesh. We check the distance between each face of the lung mesh and the rib mesh. If a face of the lung is close enough to the ribs, i.e. the distance is lower than 5 mm, the Dirichlet condition is applied on it.

Results

We used the same method as the model without ribs to obtain the solutions of this model. It is necessary to specify that the deformations studied are extrapolations and that their study makes it possible to have a tendency of the variations of volumes and pressures.

The simulations obtained with the ribs are limited in depth. We could only obtain information on the first 15 metres of depth. From a certain applied pressure (≈ 3000 Pa), we observe an inversion of the meshes. The Figure 4.6 shows the results when we applied a pressure of 2000 Pa. In the case where the ribs are taken into account, the applied pressure and the pressure of the lung tissue are not equal. Part of the applied pressure is absorbed by the ribs. The Figure 4.7 shows this difference between the two pressures. In this figure we can also see that when the ribs are taken into account the tissue pressure at a given depth is greater than the tissue pressure when the ribs are not taken into account.

The Figure 4.8 shows the air volume and pressure curves in the lungs for the model with the tissue mechanical pressure and the ribs (solid line) and for the model with the tissue mechanical pressure (dashed line). There is a small difference between the curves of the two models. We can see that the air volume curve that takes into account the ribs seems to decrease a bit more slowly, but the shift between the different curves is very small. The air pressure curve for the model with ribs grows a little slower. The blood volume curves induced by the blood shift are not shown in the figure. Since the data for the rib model can only be evaluated up to a depth of 16 msw, the blood shift does not start, and the volume is zero.

This difference in the volumes is, as explained earlier, due to the pressure of the lung tissue. In the calculations, to obtain the depth and the different volumes and pressures, the lung tissue mechanical pressure is a parameter that have a relatively small influence. In the case of the model with the ribs, the pressure of the tissues to compress is then more important, because a part is not subjected to it, that is why we have slightly different curves.

Discussion

In this section, we have presented different models to approximate lung and blood volumes during apnea. The first model 4.2, from the litterature, is based solely on Boyle's law and allows, before the "Blood Shift" occurs, to deduce the lung volume as a function of the depth. Assuming that the blood compensates for the lack of air after reaching the residual volume, we can then deduce the blood volume induced by the "Blood Shift" (Cf. Eq 4. 3).

From this model, we defined the equation 4.10. This equation introduces new volumes, with the lung volumes (V l ) being defined as the sum of the air volumes (V a ) and the lung tissue volumes (V t ). This equation assumes that the depth-induced hydrostatic pressure (p w ) is in equilibrium with the air pressure (p a ). We have p w = p a = p atm + ρ w gz.

We then took into account that the hydrostatic pressure was not exactly in equilibrium with the air pressure in the lungs. The pressure of the lung tissue (p t ) is also involved in the pressure balance. The equation for pressure equilibrium in this case is : p w = p t + p a = p atm + ρ w gz. This leads to the model 4.14.

To compute the variables of the model 4.14, such as depth or lung volumes, we use 3D numerical simulations. We have defined a lung compression model (see Eq 4. [START_REF] Denotter | Hounsfield Unit[END_REF]) based on the linear elasticity. A pressure p is applied evenly to the lungs. We used finite elements and the Deal.II library to compute solutions.

Then the model 4.19 evolved to take into account the ribs and became the model 4.26. The calculations did not provide results that could be compared with those obtained with the other models because they were limited to 16 msw.

The volumes and pressures deduced with these different models are quite similar. As we explained earlier the volume of air is dependent on the pressure of the air in the lungs which is defined either by p a = p w or by p a = p wp t . The pressure of the tissues being much lower than the hydrostatic pressure, its influence on the volumes is small.

The curves of the lung volumes, as a function of the pressure applied on their boundary domain, have been plotted in the Figure 4.9. If we compare the shift between the two models, we can clearly see that the volume seems decrease faster for the model where the ribs are not taken into account. When the ribs are taken into account, part of the applied pressure is absorbed by the ribs. This explains why the decrease in volume is less important for the model with ribs.

If we go back to the Figure 4.7, the observation is the same. To reach the same depth, the pressure applied on the lungs is higher in the case with ribs than in the case without ribs. The other important observation is that the mechanical pressure in the lung tissues is then greater in the case where the ribs are taken into account. This is important because too much tissue pressure can cause tissue crushing. It can be seen from the Figure 4.10a that the areas at risk are the tissues in the intercostal areas.

In the same way, we have calculated the shear stress in the tissue induced by the deformation. The Figure 4.10b shows the areas where the shear stress is highest. This is data that needs to be analysed in order to control the risk of lung tissue tearing. When the applied pressure is 2880 Pa, the deduced depth is 16 msw for the model with ribs. At this depth, the most important shears are located in the intercostal zones with measurements up to 4000 Pa.

It would be interesting to work with doctors to analyse this data, which is still experimental, in order to assess the risk of lung damage.

Conclusion

In this part, we use part of our 3D models in order to simulate breath-hold deep dives. Based on Schagatay's observations et al. [START_REF] Schagatay | Predicting performance in competitive apnoea diving. Part I: Static apnoea[END_REF][START_REF] Schagatay | Predicting performance in competitive apnea diving. Part II: Dynamic apnea[END_REF][START_REF] Schagatay | Predicting performance in competitive apnea diving. Part III: Depth[END_REF][START_REF] Schagatay | Effects of water and ambient air temperatures on human diving bradycardia[END_REF][START_REF] Schagatay | Effects of physical and apnea training on apneic time and the diving response in humans[END_REF][START_REF] Schagatay | Speed of spleen volume changes evoked by serial apneas[END_REF][START_REF] Schagatay | Diving response and apneic time in humans[END_REF] we were able to define the blood supply induced by the "Blood Shift". Starting from simple models 4.2 based on Boyle's law. We make the model more complex in order to better represent reality, as with the equation 4.10 :

This model allowed to have a better representation of the volumes of air and blood throughout the descent. This model provides a better approximation of the critical depth. It is from this critical depth that the "Blood Shift" effect appears. We then continued to improve this model by introducing the tissue pressure p t , and the ribs. To solve this model, we used finite element methods to obtain an estimate of lung volumes and tissue pressures. This allowed to have both a more accurate representation of the different volumes and a visual representation of the compression of the lungs during the dive. These models are linear, and we use numerical simulations to solve only one state (p = 1 Pa) and the others are determined as a function of this state. The results obtained show that the beneficial impact of the blood volume induced by the "Blood Shift". This blood volume prevents lung collapse at depths greater than the critical depth. There are, however, risks involved in the pressures and shearing of the lung tissue. We have seen that in the intercostal areas, the pressure of the lung tissue can lead to a risk of tissue crush. In the same area, some tissues can also be subjected to potentially dangerous shearing.

It would be interesting to further develop this point to measure the risk of crushing or shearing. However, these are approximations that can be improved. We considered a non-linear model where the Young's modulus of the lung tissue evolves as a function of the observed volume. This model is not yet complete and the result we obtained are not in measure to be used or analysed correctly.

Annexe

Modelling the compression of the lungs during breath-hold dive

As explained, lung compression is modelled by static deformation of the lungs. We assume that the lungs are in equilibrium and are defined by a homogeneous linear elastic material [START_REF] Brunengo | Optimal efficiency of high-frequency chest wall oscillations and links with resistance and compliance in a model of the lung[END_REF][START_REF] Berger | A poroelastic model coupled to a fluid network with applications in lung modelling[END_REF][START_REF] Pozin | A tree-parenchyma coupled model for lung ventilation simulation[END_REF][START_REF] Werner | Patient-specific finite element modeling of respiratory lung motion using 4D CT image data[END_REF]. The displacement is defined by u(x) ∈ R 3 with x ∈ Ω is the location. The equation is :

div(σ(u)) = 0 in Ω With σ(u) the stress tensor describing the local stress of a material as a function of the displacement u. A uniform pressure is applied on the boundary, noted ∂Ω of Ω. This is called the Neumann condition and is expressed as :

Stress-strain relationship

The lung is defined as a homogeneous elastic isotropic material that follows linear elasticity : σ(u) = λTr(ϵ(u))I + 2µϵ(u) (4.20)

with the identity matrix I, the strain tensor ϵ(u) = 1 2 (∇u + t ∇u) and λ and µ are the Lamé parameters, with λ the first Lamé coeficient and µ the shear modulus of the material. λ and µ can be related to the Young's modulus E and the Poisson's ratio ν of the material by :

λ = Eν (1 -2ν)(1 + ν) ; µ = E 2(1 + ν) (4.21)
Like [START_REF] Pozin | Multiscale lung ventilation modeling in health and disease[END_REF] and [START_REF] Brunengo | Étude d'un modèle visco-élastique du poumon humain et application à l'oscillation haute fréquence extra-thoracique[END_REF], we have used for the lung tissue, the Young's modulus E = 1256Pa and the Poisson's ratio ν = 0.4. This corresponds to the classical value used for the human lung, open to atmosphere and at static equilibrium [START_REF] Agostoni | Static Behavior of the Respiratory System[END_REF].

Weak formulation of the system of equations . The lung compression model is then defined by the system of equations 4.19 consisting of the elastic equation and the Neumann condition. To obtain an approximate solution of this system of equations, we will use the finite element method and a weak formulation of this system. We then define the smooth test function v : Ω → R 3 , and the weak formulation is :

- Ω div(σ(u)) • v dX = 0
We then use integration by parts, which gives us : The solutions of this system then represent the three-dimensional displacement of the lung submitted to a pressure p. The weak formulation is used to analyse the model with the finite elements technique.

Finite elements method

Equation 4.23 is a weak partial differential equation and to obtain an approximation of the solution of this equation, the finite element method (FEM) is often used in engineering and research. This method is commonly used to represent the behaviour of physical systems (mechanical, thermodynamic, acoustic, etc.). The finite element method allows to pass from a continuous equation, to a discrete equation, which allows to obtain an approximated solution on a finite number of degrees of freedom. These elements, in the 3D case, are mainly tetrahedron or hexahedron, and because we are using the FEM library deal.II [START_REF] Arndt | The \textttdeal.II Library, Version 9.4[END_REF], it will be hexahedron in our case. Each hexahedron has height vertices, and we define n v the number of vertices per cell. We work in a discrete space spanned by base functions, noted ϕ, which are polynomials of a fixed order of the space variables. We have chosen to use the lowest order (Q 1 ) finite elements, for which the degrees of freedom are associated with the vertices of the mesh. If the basis functions have a higher order, the degrees of freedom are not necessarily associated only with vertices, but also with edges, faces, or cells. With the finite element shape functions, we approximate the displacement function u and the test function v by :

u ≈ u h = N i u i ϕ i ; v ≈ v h = N j v j ϕ j (4.24)
Using the weak formulation 4.23 of the system of equations 4.19 combined with the function approximations 4.24, we then have : From this equation, we can then define a linear matrix-vector equation :

t wM U = t wa ⇒ U = M -1 a with U = (u i ) 0<=i<=n d the displacement vector containing the n d displacement component u i . The components of the matrix and vectors are :

   M ij = Ω σ(ϕ i ) • ∇ϕ j dX a j = -∂Ω (p t • n) • ϕ j dX
We will then use the deal.II finite element library to build the basis functions and to obtain the solution to the linear matrix-vector equation 4.26.

Taking into account the ribs

In the model 4.19, we apply a homogeneous pressure on the entire lung surface In the thorax, the rib cage is where the lungs are located. The displacement of the ribs during breath-hold diving is significantly less than the displacement of the lung because they are bones with a higher resistance to hydrostatic pressure. We adapted the equation 4.19 by subdividing the boundary domain ∂Ω into two sub-domains Γ 1 and Γ 2 . The first domain is the boundary where the Neumann condition is applied. The domain Γ 2 represents the ribs, on which we will apply a Dirichlet condition, assuming that the rib displacement is negligible relatively to the lung displacement. The Equation 4.19 then becomes : The component of linear equation 4.26 obtained with the finite elements becomes :

   M ij = Ω σ(ϕ i ) • ∇ϕ j dX a j = -Γ 1 (p t • n) • ϕ j dX
For each degree of freedom i in Γ 2 , the Dirichlet condition is applied by setting M ii = 1, M ij = 0 and a i = 0, which induces u i = 0.ă To identify the boundary domain Γ 2 on the lung mesh, we had to obtain the location on the lung's boundary mesh where the ribs are in contact with the lungs. The method for segmenting the ribs was defined in a previous section.

Implementation with deal.II

In this section, we will present the implementation of our elastic model simulating the compression of the lungs during apnea. It is based on one of the tutorials (among the 85 available) in the documentation of deal.II [START_REF] Arndt | The \textttdeal.II Library, Version 9.4[END_REF]. This library is implemented in C++, object-oriented, and which bases its functioning on quadrangular (2D) or hexahedral (3D) finite elements.

For this project, we will work on the lung meshes obtained with the segmentation process presented in chapter 2. The meshes computed are triangular surface meshes, so we used GMSH [START_REF] Geuzaine | Gmsh: A 3-D finite element mesh generator with built-in pre-and post-processing facilities[END_REF] to create tetrahedral volume meshes (Cf. Then, we choose the type of finite elements, in our case Lagrange finite element of degree 1. The degrees of freedom (DoF), representing the spatial position where the solution will be defined, are then associated to the vertices of the cells of the mesh. After this step, we initialise the different matrix and vectors before proceeding to the evaluation of the integrals of the shape functions and their derivatives according to the weak formulation. The matrix is often sparse. Then comes the assembly phase where we define the components of the different matrix. This is where we evaluate the integrals of the shape functions. To compute the integrals, a quadrature method is need, it consists in replacing the calculation of the integral of a function system. When the assembly is completed, the penultimate step is the resolution of the linear system. To solve the linear system, we used the conjugate gradient method.

Finally, the results are saved in a VTK file and are analysed using Julia Language to extract the information on the volumes, the pressures and the shear stress. It is only necessary to calculate the solution for a single external pressure and then the other solutions are deduced from this single calculation. Indeed, the equation is linear in the applied boundary pressure. We compute the solution u 1 for an applied external pressure 1 Pa and the solution for an applied pressure p is then :

u p = p × u 1
(4.28)

Preliminary non-linear model with an adaptive Young's modulus

Our previous apnea model is linear and the solution for any applied pressure p is proportional to the solution that we computed for p = 1 Pa.

However, the Young's modulus depends on the volume of the lung [START_REF] Agostoni | Static Behavior of the Respiratory System[END_REF][START_REF] De | Stress distribution in a three dimensional, geometric alveolar sac under normal and emphysematous conditions[END_REF]. This has an impact on the Lamé parameters, whose values would evolve with depth. Here, the Young's modulus E(u) depends on the deformed lung volume V (u) = Ω det(I +∇u)dx of the deformed domain:

E(u) = F Agostoni Ω det(I + ∇u)dx (4.29)
To define F Agostoni , we use the lung volume -lung pressure dotted curve shown in Figure 1.6. The curve represents the volume of the lung as a function of the pressure difference between the alveoli and the lung wall. We define the inverse function of this curve, allowing us to have the pressure difference between the alveoli and the lung wall as a function of the lung volume. Note that V (u) = V lung . Let K be the bulk modulus of the lung tissues. We can define K as a function of V lung by :

K(V lung ) = V lung × dP dV (4.31)
However, dP dV at volume V lung is the derivative of the function P l with respect to V lung taken in V lung , then : This equation is linear in p, then denoting v 1 the solution of this equation for p = 1 Pa, we can deduce that v = p v 1 . The solution v 1 can be computed numerically, for example by using finite elements.

K(V lung ) = V lung × dP l dV lung (V lung ) = 1100 × V lung V l,tlc + 16800 × V lung V l,tlc
Then, the relationship v = p v 1 leads to

E(u)u = p v 1 or u = p E(u) v 1
Then recomputing E(u) from this expression of u brings

E(u) = F Agostoni Ω det I + p E(u) ∇v 1 dx (4.34)
We solved the equation (4.34) using Julia language and the Newton's method. We computed for each p, E(u) and finally u = p E(u) v 1 . We were able to test this model, starting by generating the solution of equations 4.33 to compute the displacement at p = 1 Pa, when the ribs are taken into account. Then from this displacement, we could calculate the Young's Modulus for pressures ranging from 10 Pa to 3000 Pa with a step of 10 Pa. We compared the lung volumes as a function of the applied pressure for the linear model without ribs, for the linear model with ribs and for the non-linear model with ribs (See Figure 4.13). One can observe that the volume curve of the non-linear model decreases considerably slower than the linear models. The differences between the linear and the non-linear models comes from the difference of the Young's modulus. For the linear models, the Young's modulus E = 1256 Pa, for the non-linear model, the Young's modulus values range from 10000 Pa to 4000 Pa. A higher Young's modulus means that the material is stiffer and the pressure applied, to deform it, is higher. The preliminary model and its results are encouraging and show the potentioal of this non-linear approach. The next step would be to improve our way of estimating the Young's modulus.

Chapter 5

Conclusion

The objective of this thesis is to propose a tool to extract from medical images, 3D meshes of morphological structures of the lower pulmonary system. These structures can be used in numerical simulations to represent mechanical phenomena in the lungs. We used the resulting lung meshes in a numerical simulation to study breath-hold diving.

To begin with, we worked on medical images, and more specifically on thoracic CT scans, with the aim of extracting as much information as possible about the position of the various visible parts of the lower respiratory system. The tool we have developed allows to identify and delineate the different lobes of the lung and part of the bronchial tree. For this, we based our tool on segmentation methods via Deep Learning and in particular the U-Net architecture, often used for segmentation on medical images. We made some modifications to the basic architecture by adding layers such as BatchNorm, PRelu or Attention Gates. In addition to these modifications, we wanted to implement a method based on the three-dimensional representation of CT scans, allowing us to transform our U-Net model from 2D to 2.5D. The U-Net architecture is specifically defined to work with 2D images, so we fed our algorithm with the different slices of the CT-Scans of each slice plane (axial, sagittal and coronal). This allows us to have a model capable of providing a prediction in each slice plane, which we aggregate into a single prediction using a weighted average. Finally, and to remove the few artefacts, we developed a correction using connected elements. The results of our segmentation method, applied to the LUNA-16 challenge data extracted from the LIDC-IDRI library, are very encouraging and show that our model performs as well as or better than some V-Net (U-Net in 3D) models in the literature. Other ideas for improving the model, such as the segmentation of blood vessels to refine our predictions, are also under consideration.

The second part of our tool is the creation of an algorithm to generate a model of the bronchial tree that fits into the lung lobe meshes and that completes the first generations extracted from the CT-Scans. The algorithm developed is based on the methods of Kitaoka et al. and Tawhai et al.. The principle is to combine the benefits of each modelwith updated or new methods. To generate a model of the bronchial tree, we rely on the results from the segmentation algorithm.

From the segmentations, we generate a mesh of the lobes and a skeleton of the first generations of the bronchial tree. With these elements we apply our deterministic algorithm to generate a model of the rest of the bronchial tree. The principle of this algorithm is to repeat the step that generates a branch associated to a volume and that subdivides this volume into two smaller volumes on which the step is repeated. Our method is able to create a bronchial tree that respects well the mophometric measurements obtained by Weibel et al. and Horsfield et al. It can also be modulated by modifying certain branches generation parameters so that the bronchial tree model obtained can have more or less symmetrical bifurcations, and be more or less deep. The novelty of this algorithm is the process we use to define a branch. Tawhai's model, which was the most successful model, uses the barycentre of a volume to define a branch. However, the volumes associated with the branches are very often non-convex and their barycentre can be located outside their corresponding volumes. We have defined a method to choose between the barycentre or the Pole of Inaccessibility (PoI), which is the centre of the largest sphere inscribed in a volume. This method is based on the signed distance between each of the points and makes the choice according to these distances in order to guarantee that the branch will always be included in this volume. For the calculation of PoI, we used the octree method. With the contribution of these new methods, our model is able to create a model of the bronchial tree reflects well the mophometric data. Its scalability was demonstrated with the statistical data of the different models we have generated. The final output of this algorithm is a mesh of the bronchial tree, as well as a skeleton of this tree. Each branch of the skeleton has a diameter which allows to generate easily a new mesh by modifying the value of these diameters, to mimic for example the constriction of branches as during an asthma attack.

In our final section, we set out to understand and model how the lungs behave during breathhold diving. We started this work by recalling the basic models from the literature, which are based on Boyle-Mariotte's law. We then extended this model taking into account the data available to us. The basic model is based on the volume of air contained in the lungs, which was obtained by spirometric measurement. We have adapted the basic model to our data. As we work on the models obtained with our algorithms, we have the lung volume, which is the sum of the volume of air in the lungs and the volume of lung tissue. The basic model assumes that the hydrostatic pressure of the water, induced by the depth, and the pressure of the air in the lungs are in equilibrium. We account for the lung tissue pressure, which intervenes in the pressure equilibrium : the hydrostatic pressure is in equilibrium with the sum of the tissue pressure and the air pressure. TO determine the tissue pressure, we used finite element methods to simulate the lung deformation. We took into account the contribution of the ribs to the problem. Finally, we used a lung volume-dependant Young's modulus for the lung tissue.We have analysed the volumes obtained from the water pressure compression, and concluded that the "Blood Shift" is undeniably beneficial for freedivers. This phenomenon, occuring from a certain depth, increases the amount of blood in the lungs and counteract the loss of air volume below the residual volume of the lungs. This phenomenon makes it possible to considerably extend the depths reachable by a human being while preserving the lungs.

The algorithm we have presented allows us to obtain very high quality and realistic 3D meshes of the lung/bronchial tree pair. This allows to work on models adapted and adaptable to a wide range of studies. There is still room for improvement, especially in the area of segmentation, where methods are currently in constant evolution. The use of these geometries specific to each patient is a powerful tool to improve our understanding of the respiratory mechanics and of the lung pathologies, more particularly as an help for diagnosis and potentially for setting up new treatments.

Contents 1 . 1 12 1. 1 . 3 12 1. 1 . 4 14 1. 1 . 6 16 1. 2 17 1. 2 . 1 19 1. 3 20 1. 3 . 1 26 1. 4

 1112131214141616217211932031264 Human lung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.1.1 Anatomy and main features . . . . . . . . . . . . . . . . . . . . . 10 1.1.2 Pulmonary Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . Bronchial Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . Respiratory zone . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.1.5 Breathing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Elastic properties of lung tissue . . . . . . . . . . . . . . . . . . . Model of Human Lung . . . . . . . . . . . . . . . . . . . . . . . Segmentation of lung . . . . . . . . . . . . . . . . . . . . . . . . . 171.2.2 Model of the bronchial tree . . . . . . . . . . . . . . . . . . . . . Competitive apnea diving . . . . . . . . . . . . . . . . . . . . . Factor of performance . . . . . . . . . . . . . . . . . . . . . . . . 21 1.3.2 Depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Objectives of the thesis . . . . . . . . . . . . . . . . . . . . . . . 26

Figure 1 . 1 :

 11 Figure 1.1: Illustration of the thorax and the pleural cavity. Illustration from Anatomy & Physiology, Connexions Web site. (http://cnx.org/content/col11496/1.6)

Figure 1 . 2 :

 12 Figure 1.2: Cast of a human lung from E.R. Weibel. The left part is composed of the bronchi and the right part is composed of the arteries, in red, and the veins, in blue.

Figure 1 . 3 :

 13 Figure 1.3: Graphic representation of the Weibel's symmetric model of the lung, constituted of 24 successive generations.

Figure 1 . 4 :

 14 Figure 1.4: Graphic representation of inspiration and expiration. Illustration from Vecteezy (https://fr.vecteezy.com/vecteur-libre/diaphragme)

Figure 1 . 5 :

 15 Figure 1.5: Graphic representation of the different lung volumes.

Figure 1 . 6 :

 16 Figure 1.6: Curve of the relation between volume and pressure from Agostoni et al.[START_REF] Agostoni | Static Behavior of the Respiratory System[END_REF]. Taken from[START_REF] Mauroy | Toward the modeling of mucus draining from human lung: role of airways deformation on air-mucus interaction[END_REF]. Respiratory system pressure: pressure difference between the thorax and the alveoli. Lung pressure: pressure difference between the alveoli and the pleural pressure (= pressure at the walls of the lungs). 1cmH 2 O=100Pa

Figure 1 . 7 :

 17 Figure 1.7:The factors influencing performance in competitive diving apnea. Taken from[START_REF] Schagatay | Predicting performance in competitive apnoea diving. Part I: Static apnoea[END_REF]

Figure 1 . 9 :

 19 Figure 1.9: Heart rate (continuous line) during a Constant Weight with Fin (CWT) dive by Annelie Pompe.Taken from[START_REF] Schagatay | Predicting performance in competitive apnea diving. Part III: Depth[END_REF]

Figure 2 . 1 :

 21 Figure 2.1: Example of thresholding-based segmentation, the boundary-based segmentation, the region-based segmentation.

Figure 2 . 2 :

 22 Figure 2.2: "Evolution of object recognition or scene understanding from coarse-grained to fine-grained inference: classification, detection or localization, semantic segmentation, and instance segmentation.". Taken from[START_REF] Garcia-Garcia | A survey on deep learning techniques for image and video semantic segmentation[END_REF]

Figure 2 . 3 :

 23 Figure 2.3: U-Net Architecture as defined by Ronnebergeret al. [85]

Figure 2 . 4 :

 24 Figure 2.4: Example of the CT-Scan visualisation. (a) Axial plane. (b) Coronal plane. (c) Sagittal plane

Figure 2 . 5 :

 25 Figure 2.5: Representation of the ReLU and PReLU activations. x is the input of the activation layer, y is the ouput of the activation layer

Figure 2 . 6 :

 26 Figure 2.6: Attention U-Net Architecture. Inspired from[START_REF] Oktay | Attention u-net: Learning where to look for the pancreas[END_REF]

Figure 2 . 7 :

 27 Figure 2.7: Skeleton obtained and the subdivision of the skeleton according to the lobes, upper lobe in blue and lower lobe in red. (a), (b) and (c) Lung skeleton, (d), (e) and (f) Subdivided skeleton

  (a) with "Mean Curvature Flow Skeleton" (b) with "Mean Curvature Flow Skeleton" (c) with "Mean Curvature Flow Skeleton" (d) with minimum distance (e) with minimum distance (f) with minimum distance

Figure 2 . 8 :

 28 Figure 2.8: Distance of the mesh point with the associated point on the skeleton. (a), (b) Distance with the "Mean Curvature Flow Skeleton". (c), (d) Distance with the minimum distance.

Figure 2 . 9 :

 29 Figure 2.9: Distribution of the distance of the mesh point with the associated point on the skeleton. (a)Distance with the "Mean Curvature Flow Skeleton". (b) Distance with the minimum distance.

Figure 2 . 10 :

 210 Figure 2.10: Mesh obtained with the reconstruction and the ground-truth mesh of the lobes. (a), (d) Left lobes with the "Mean Curvature Flow Skeleton" connection.(b), (e) Left lobes with the ground-truth (c), (f) Left lobes with the minimum distance connection.

Figure 2 . 11 :

 211 Figure 2.11: Distance of the mesh point with the associated point on the skeleton. (a), (b) Distance with the "Mean Curvature Flow Skeleton". (c), (d) Distance with the minimum distance.

  (a) Left fissure of the ground-truth (b) Cutting plane define with the left lobar branches (c) Left fissure of the prediction

Figure 2 . 12 :

 212 Figure 2.12: Cutting plane defined by the left lobar branches

Figure 2 .

 2 Figure2.13: B-Splines obtained with G+smo for the ground-truth (in red) and the prediction (in blue)[START_REF] G+smo | [END_REF]

Figure 2 . 14 : 3 3 . 2 3 . 3

 21433233 Figure 2.14: Example of segmentation of the aorta and calcifications

Figure 3 . 1 :

 31 Figure 3.1: The two methods of numbering the generations. (a) Weibel Ordering, the branches are numbered downward starting with the main stem as zeros. (b) Horsfield Ordering, the branches are numbered upward starting with the end branches as zero.Taken from[START_REF] Horsfield | Computer simulation of the geometry of the human bronchial tree[END_REF]

Figure 3 . 2 :

 32 Figure 3.2: Extraction of the surface meshes from data

Figure 3 .

 3 Figure 3.3: Simplification of the lobes surface meshes

Figure 3 . 4 :

 34 Figure 3.4: Extraction of the skeleton from the bronchial tree mesh

;

Figure 3 . 5 :

 35 Figure 3.5: Dichotomous branching that occurs in a single plane. Diameters of parent and daughters are d 0 , d 1 and d 2 , respectively. r i are the flow dividing ratio between mother and daughter. θ 1 and θ 2 are the branching angles.Taken from[START_REF] Kitaoka | A three-dimensional model of the human airway tree[END_REF]

Figure 3 . 6 :

 36 Figure 3.6: Bronchial tree generation in 2D, with Tawhai et al. model. (a) Grouping of points to the nearest branch (b) Subdivision of the points according to the plane defined by the branch and its mother and computation of the center of mass (c) Creation of new bronchial tubes with a check on length and angle

5 .

 5 Statistical analysis on the branch, the morphological parameters. (Optional) 6. Saving of the generation created in the form of a skeleton, a tubular mesh and volumes associated with the branches. (Optional) 7. Separation of the closed surface mesh, whose associated branch is not terminal, into two new closed surface meshes, using a plane, called the cutting plane. (Cf. Fig 3.7a).

Figure 3 . 7 :

 37 Figure 3.7: Bronchial tree generation in 2D, with our model. (a) Subdivision of the closed area mesh with the cutting plane. (b) Calculation of the barycentre and PoI. (c) Generation of daughter branches. (d) Repetition of the steps

Figure 3 . 8 :

 38 Figure 3.8: Example of the changes between the differents center of cutting plane. (a) Cutting plane centered on the barycentre. (b) Cutting plane centered on the end of the branch

Figure 3 . 9 :

 39 Figure 3.9: Ear Clipping method, from [21].

Figure 3 . 10 :

 310 Figure 3.10: 3D model of a bronchial tree obtained with our algorithm. Plane Center = End, Plane Vector = Sister, Branch Direction = Hybrid, Decision Ratio = 0.95, Angle Correction = Activated, Branching Angle Threshold = 96°. Yellow : Right Upper Lobe, Green : Right Middle Lobe, Red : Right Lower Lobe, Blue : Left Upper Lobe, Orange : Left Lower Lobe, Purple : Bronchial Tree

Figure 3 . 11 :

 311 Figure 3.11: Graphs of the morphometric parameters per generation of the bronchial tree obtained with the default parameters. Plane Center = End, Plane Vector = Sister, Branch Direction = Hybrid, Decision Ratio = 0.95, Correction of Branching Angle = Activated, Branching Angle Threshold = 96°. (a) Mean diameter of the branches per generation. (b) Mean lenght of the branches per generation. (c) Mean ratio L D per generation. (d) Distribution of the branching angles for the generated bronchial tree. (e) Mean reduction factor of the diameter per generation D daughter D mother . (f) Mean assymetry per generation Dminor Dmajor . The dotted black line represents the average of each morphological parameter for the whole bronchial tree.

  . The model of Tawhai et al. and the model of Montesantos et al., are within the Weibel observed range of [2.8, 3.25]. The asymmetry of our model, represented by the data D minor /D major , is evaluated at 0.84 and remains consistent with the model of Tawhai et al. and with the observations of Phalen et al. and Weibel et al. who estimated this value at 0.86. The Bordas et al. model seems to be more symmetrical than the other models with 0.97.

  70 and 0.85 which is close to the model of Tawhai et al. with 0.69 and 0.88. The Montesantos et al. model has a larger difference with 0.66 and 0.91. The Bordas model reflects the symmetry observed in its model with a small difference between the two reduction factors with 0.81 and 0.85.

Figure 3 . 12 :

 312 Figure 3.12: Histogram of the "score" according to the parameters of the model for the cutting plane and the direction of the branch. The lowest "score" corresponds to the best model.

Figure 3 . 13 :

 313 Figure 3.13: Evolution of mean morphometric parameters of the branches as a function of the threshold branching angle. (a) Mean generation of the terminal branches. (b) Mean Ratio Length/Diameter. (c) Mean branching angle.(d) Mean assymetry ratio DminorDmajor . The dotted black line represents the mean of each morphological parameter when the bronchial tree correction is not activated.

Figure 3 . 14 : 4 Deep-Diving Contents 4 . 1 117 4. 1 . 1 4 . 2 4 . 3 4 . 4 4 . 5

 3144411171142434445 Figure 3.14: Surface of theoretical results for different threshold branch angle and decision ratio parameters. (a), (c) Threshold branching angle going from 50°to 120°with a step of 10°and a decision ratio going from 0 to 1 with a step of 0.05. (b), (d) Threshold branching angle going from 95°to 100°with a step of 1°and a decision ratio going from 0.95 to 1 with a step of 0.01

Figure 4 . 1 :

 41 Figure 4.1: Graphs of the air volume (V a (z)) and of the blood volume induced by the blood shift (V b (z)) during the apnea diving. The vertical dotted lines represent the critical depths of each subject. The critical depth is the point where the critical volume of the lung is reached

Figure 4 . 2 :

 42 Figure 4.2: Mean tissue pressure p t depending on the depth z.

  19 by decomposing the boundary domain ∂Ω into two subdomains Γ 1 and Γ 2 . The first domain represents the boundary where the Neumann condition, simulating the external pressure, is applied. The domain Γ 2 represents the ribs, on which we apply a Dirichlet condition, assuming that the rib displacement is negligible relatively to the lung displacement. The Equation 4.19 then becomes :

Figure 4 . 3 :

 43 Figure 4.3: Volumes and pressure with Equation 4.13. Data came from CT-Scan

  (a) Result after thresholding (b) Result after keeping the largest connected volume (c) Result after cutting the ribs

Figure 4 . 4 :

 44 Figure 4.4: Rib extraction process

Figure 4 . 5 :

 45 Figure 4.5: Result of defining the boundary domains, in red Γ 1 and in white Γ 2

Figure 4 . 6 :

 46 Figure 4.6: Lung compression results taking into account the ribs. (a) Initials meshes. (b) Results when applied a pressure p = 2000 Pa

  Tissue Pressure p t Model without the ribs

Figure 4 . 7 :

 47 Figure 4.7: Mean tissue pressure p t , and applied pressure p depending on the depth z. The dashed line represents the applied pressure and the tissue pressure when the ribs are not taken into account.

Figure 4 . 8 :

 48 Figure 4.8: Volumes and pressure with Equation 4.13 for the model with the ribs and without the ribs. Data came from CT-Scan.

Figure 4 . 9 :

 49 Figure 4.9: Lung volumes depending of the pressure applied on boundary domain during the numerical simulation.

Figure 4 . 10 :

 410 Figure 4.10: Tissue and shear mesured for a pressure applied at 2880 Pa. The model take into account the ribs.

  σ(u) • n = -p • n on ∂ΩThe equation system modelling the compression of the lung is defined as :   div(σ(u)) = f (x, t) in Ω σ(u) • n = p • n on ∂Ω (4.19)

Ω

  σ(u) • ∇v dX = ∂Ω (σ(u) • n) • v dS (4.22)Finally, with the Neumann boundary condition, we have :Ω σ(u) • ∇v dX = -∂Ω (p • n) • v dX (4.23)

  i ) : ∇ϕ j dX = -• n) • ϕ j dX (4.25)

- 2 ( 4 . 26 )

 2426 div(σ(u)) = 0 in Ω σ(u) • n = -p • n on Γ 1 u = 0 on ΓThis also implies redefining the weak formulation 4.23 by adding the subdivision of the boundary.   Ω σ(u) • ∇v dX = -Γ 1 (p • n) • v dX on Ω u = 0 and w = 0 on Γ 2 (4.27)

Figure 4 .

 4 11a), and then we used the Tethex [108] tool to convert tetrahedral meshes into a hexahedral meshes (Cf.

Figure 4 .

 4 11b).

P 6 ( 4

 64 l (V (u)) = 100 + 1100 × V (u) V l,tlc + 2800 × V (u) V l,tlc

Figure 4 . 12 :

 412 Figure 4.12: Young's Modulus solution depending of the pressure applied on boundary domain

Figure 4 . 13 :

 413 Figure 4.13: Lung volumes depending of the pressure applied on boundary domain for the two linear models and the non-linear model

Table 1 .

 1

1: Table of current records for some competitive freediving disciplines.

Contents 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

  .1.1 Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.2 Base of the pulmonary lobes segmentation . . . . . . . . . . . . .

	Segmentation on CT-Scan

2.2 Patient data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

  .3.1 Binary segmentation . . . . . . . . . . . . . . . . . . . . . . . . .

	2.3.2 2.5D Multi-class segmentation . . . . . . . . . . . . . . . . . . .
	2.3.3 2.5D multi-class segmentation with attention gates . . . . . . . .

2.4 Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

	2.5.1 Benefit of the Weighted Average . . . . . . . . . . . . . . . . . .
	2.5.2 Comparison of 2.5D multi-class segmentation algorithms . . . . .
	2.5.3 Benefits of post-processing via connected components . . . . . .

2.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7 Ideas of improvements . . . . . . . . . . . . . . . . . . . . . . .

  Skeleton of the lobes . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.2 Spline method . . . . . . . . . . . . . . . . . . . . . . . . . . . .

	2.7.1

2.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Table 2 .

 2

1: Confusion table between prediction and ground-truth

Table 2 .

 2

	Plane	RU	RM	RL	LU	LL	BT	Lung	Avg Lobes
	Precision
	Axial	93.70	69.24	92.67	97.72	96.81	91.24	97.91	93.22
	Coronal	92.92	59.88	90.81	98.10	97.30	90.47	98.27	91.66
	Sagittal	91.79	65.25	89.17	89.89	91.26	93.78	98.39	88.40
	Average	96.60	75.40	93.96	98.65	97.53	96.97	99.08	95.08
	Recall
	Axial	90.36	85.97	97.26	96.87	97.26	74.81	99.62	94.85
	Coronal	83.70	85.32	96.70	96.44	97.03	75.13	99.67	92.97
	Sagittal	76.27	84.27	92.14	95.32	95.39	73.22	99.57	89.46
	Average	88.75	90.19	98.39	98.05	98.66	76.39	99.63	95.61
	F1-Score
	Axial	92.00	76.71	94.91	97.29	97.03	82.21	98.76	94.03
	Coronal	88.07	70.37	93.67	97.27	97.16	82.09	98.96	92.31
	Sagittal	83.31	73.55	90.63	92.53	93.28	82.24	98.98	88.92
	Average	92.51	82.14	96.13	98.35	98.09	85.46	99.35	95.34
	Specificity
	Axial	99.79	99.65	99.73	99.91	99.90	99.99	99.64	99.80
	Coronal	99.78	99.48	99.65	99.93	99.92	99.98	99.71	99.75
	Sagittal	99.77	99.59	99.60	99.59	99.72	99.99	99.73	99.65
	Average	99.89	99.73	99.78	99.95	99.92	100.00	99.84	99.85
	Accuracy
	Axial	99.48	99.53	99.64	99.80	99.82	99.93	99.64	99.65
	Coronal	99.25	99.35	99.55	99.80	99.83	99.93	99.70	99.56
	Sagittal	98.98	99.45	99.35	99.43	99.59	99.94	99.70	99.36
	Average	99.52	99.65	99.73	99.88	99.88	99.95	99.81	99.73

2: Results of the metrics for the different planes (Axial, Coronal and Sagittal) and the average of them, all with the use of the algorithm Attention Gate and without the connected component post-processing. RU, RM, RL, LU, LL and BT are used to represent the right upper lobe, right middle lobe, right lower lobe, left upper lobe, left lower lobe and bronchial tree, respectively.

Table 2 .

 2 4.

	Axial	Coronal	Sagittal
	CT-Scan
	Ground Truth
	Axial
	Coronal
	Sagittal
	Average

Table 2 . 3

 23

	Algorithm	RU	RM	RL	LU	LL	BT	Lung	Avg Lobes
	Precision
	Dice Loss	96.91	71.83	92.83	99.21	94.40	97.73	99.26	93.96
	Tversky Loss	97.01	73.86	92.91	98.89	96.98	97.07	99.29	94.68
	Dice/Focal Loss	96.79	74.83	92.92	98.77	96.85	93.29	99.04	94.65
	Attention Gates	96.60	75.40	93.96	98.65	97.53	96.97	99.08	95.08
	Recall
	Dice Loss	85.74	88.12	98.16	95.02	99.03	70.78	99.33	94.03
	Tversky Loss	86.81	89.47	97.97	97.02	98.51	73.62	99.32	94.72
	Dice/Focal Loss	87.26	91.46	98.15	97.55	98.91	77.49	99.62	95.21
	Attention Gates	88.75	90.19	98.39	98.05	98.66	76.39	99.63	95.61
	F1-Score
	Dice Loss	90.98	79.15	95.42	97.07	96.66	82.10	99.29	93.99
	Tversky Loss	91.63	80.92	95.37	97.95	97.74	83.73	99.30	94.70
	Dice/Focal Loss	91.78	82.31	95.46	98.15	97.86	84.66	99.33	94.93
	Attention Gates	92.51	82.14	96.13	98.35	98.09	85.46	99.35	95.34
	Specificity
	Dice Loss	99.91	99.69	99.73	99.97	99.82	100.00	99.88	99.82
	Tversky Loss	99.91	99.71	99.73	99.96	99.90	100.00	99.88	99.84
	Dice/Focal Loss	99.90	99.72	99.73	99.95	99.90	99.99	99.84	99.84
	Attention Gates	99.89	99.73	99.78	99.95	99.92	100.00	99.84	99.85
	Accuracy
	Dice Loss	99.43	99.58	99.68	99.79	99.79	99.94	99.80	99.66
	Tversky Loss	99.47	99.62	99.67	99.85	99.86	99.94	99.80	99.70
	Dice/Focal Loss	99.48	99.65	99.68	99.87	99.87	99.94	99.81	99.71
	Attention Gates	99.52	99.65	99.73	99.88	99.88	99.95	99.81	99.73

: Visualisation of the results for the different planes (Axial, Coronal and Sagittal) and the average of them, all with the use of the algorithm Attention Gate and without the connected component post-processing. Yellow : Right Upper Lobe, Green : Right Middle Lobe, Red : Right Lower Lobe, Blue : Left Upper Lobe, Orange : Left Lower Lobe, Purple : Bronchial Tree

Table 2 .

 2

4: Results of the metrics for the different algorithms (Dice Loss, Tversky Loss, Dice/Focal Loss and Attention Gates), all with the use of the weighted average and without the connected components. RU, RM, RL, LU, LL and BT are used to represent the right upper lobe, right middle lobe, right lower lobe, left upper lobe, left lower lobe and bronchial tree, respectively.

Table 2 . 5

 25

	Post-Processing	RU	RM	RL	LU	LL	BT	Lung	Avg Lobes
	Precision
	Without	96.60	75.40	93.96	98.65	97.53	96.97	99.08	95.08
	With	96.64	75.61	93.98	98.67	97.51	97.07	99.07	95.11
	Recall
	Without	88.75	90.19	98.39	98.05	98.66	76.39	99.63	95.61
	With	88.84	90.26	98.39	98.06	98.69	76.14	99.63	95.64
	F1-Score
	Without	92.51	82.14	96.13	98.35	98.09	85.46	99.35	95.34
	With	92.58	82.29	96.14	98.36	98.10	85.34	99.35	95.37
	Specificity
	Without	99.89	99.73	99.78	99.95	99.92	100.00	99.84	99.85
	With	99.89	99.73	99.78	99.95	99.92	100.00	99.84	99.85
	Accuracy
	Without	99.52	99.65	99.73	99.88	99.88	99.95	99.81	99.73
	With	99.53	99.65	99.73	99.88	99.88	99.95	99.81	99.73

: Visualisation of the results for the different algorithms (Dice Loss, Tversky Loss, Dice/Focal Loss and Attention Gates w/ Dice/Focal Loss), all without the connected component post-processing. Yellow : Right Upper Lobe, Green : Right Middle Lobe, Red : Right Lower Lobe, Blue : Left Upper Lobe, Orange : Left Lower Lobe, Purple : Bronchial Tree

Table 2 .

 2 6: Results of the metrics for the Attention Gates algorithm without and with the connected components post-processing. RU, RM, RL, LU, LL and BT are used to represent the right upper lobe, right middle lobe, right lower lobe, left upper lobe, left lower lobe and bronchial tree, respectively. W/o PP and W/ PP are used to represent the algorithm without the connected component post-processing and the algorithm with the connected component post-processing, respectively.

	Axial	Coronal	Sagittal
	CT-Scan
	Ground Truth
	W/o Post-Processing
	W/ Post-Processing

Table 2 . 7

 27 Tang et al., Chen et al. and Gu et al.. Table2.8 shows the values of F1-Score, Precision and Recall for each lobe and the average of each lobe. However, in addition to the lung lobes, our algorithms also perform a segmentation of the respiratory branches, such as the trachea or the pulmonary branches. Except our algorithm and the algorithm of Chen et al., all the other architectures are based on the 3D version of the U-Net architecture, called the V-Net.

	Algorithm	RU	RM	RL	LU	LL	BT	Avg Lobes
	F1-Score
	Ferreira [24]	93	87	95	95	94		93
	Tang [104]	92.53	80.60	93.05	96.10	95.30	-	91.48
	Chen [15]	82	64	82	84	84	-	-
	Gu [32]	95.07	90.03	94.84	95.79	94.79	-	-
	Imran [41]	93.70	88.20	95.60	96.60	96.60	-	93.90
	AG	92.58	82.29	96.14	98.36	98.10	85.34	95.37
	Precision
	Chen [15]	89	76	87	88	93	-	-
	AG	96.64	75.61	93.98	98.67	97.51	97.07	95.11
	Recall
	Chen [15]	87	74	92	93	89	-	-
	Gu [32]	96.13	92.38	96.03	98.23	96.14	-	-
	AG	88.84	90.26	98.39	98.06	98.69	76.14	95.64

: Visualisation of the results for the Attention Gates algorithm without and with the connected components post-processing. Yellow : Right Upper Lobe, Green : Right Middle Lobe, Red : Right Lower Lobe, Blue : Left Upper Lobe, Orange : Left Lower Lobe, Purple : Bronchial Tree algorithms of Ferreira et al.

Table 2 .

 2 8: Results of the metrics for the different algorithms of the litterature and our algorithm with Attention Gates and post-processing. RU, RM, RL, LU, LL and BT are used to represent the right upper lobe, right middle lobe, right lower lobe, left upper lobe, left lower lobe and bronchial tree, respectively. AG is used to represent the Attention Gates algorithm.

  have also been proposed and are inspired by the work of Tawhai et al.. In this chapter, we propose a new algorithm based on the works of Tawhai et al. and Kitaoka et al.. Since these models have been proposed, computer power and tools have evolved enormously. Thus, it is now possible to develop more precise computation methods based on new geometric representations. We propose a new algorithm that is not any more based on points clouds but instead on reconstructions of morphological structures. The branches geometries are generated based on biophysical constraints, which are inspired from the work of Kitaoka et al.. Our algorithm is able to generate trees that fit well the morphometric data and outputs meshes that can be used directly for scientific computing.

Table 3 .

 3 .1. 1: Adjustable parameters for bronchial tree generation Our work allows to generate a set of models for the bronchial tree by exploring the different setups listed in Table3.1.

	Plane Center (PC)
	Barycentre	PoI	End
	Plane Vector (PV)
	Sister	Mother
	Branch Direction (BD)
	Barycentre	PoI	Hybrid
	Branching Angle Correction
	Activated	Deactivated
	Branching Angle Correction Threshold : [50°; 180°]
	Decision Ratio r d : [0; 1]

Table 3 .

 3 2: Statistical data of bronchial tree depending on the organ. The model uses the following parameters : Plane Center = End, Plane Vector = Sister, Branch Direction = Hybrid, Decision Ratio = 0.95, Angle Correction = Activated, Branching Angle Threshold = 96°A

		Min-Max	Mean	Mean
	Organ	Terminal	Terminal	Branching	Asymmetry	Score
		Generation	Generation	Angle
	Left Lobes
	Lower	11-33	16.88 ± 2.61	39.00 ± 24.34	0.85 ± 0.16	0.0240
	Upper	10-33	17.11 ± 2.85	36.08 ± 24.79	0.83 ± 0.16	0.0173
	Right Lobes
	Lower	10-33	15.44 ± 2.29	34.25 ± 25.25	0.82 ± 0.15	0.0337
	Middle	9-33	15.83 ± 2.71	32.95 ± 24.56	0.80 ± 0.16	0.0507
	Upper	10-33	16.75 ± 2.38	39.40 ± 24.05	0.85 ± 0.16	0.0254
	Lungs
	Left	10-33	16.99 ± 2.73	37.54 ± 24.61	0.84 ± 0.16	0.0077
	Right	9-33	16.23 ± 2.50	36.70 ± 24.63	0.83 ± 0.16	0.0115
	All	9-33	16.61 ± 2.65	37.12 ± 24.62	0.84 ± 0.16	0.0072

  al. to 0.79. Tawhai et al. and Montesantos et al. have exactly the desired value. Our model is within 0.01 of the desired value with 0.78 and the Bordas et al. model does a little

Table 3 .

 3 3: Statistical data of bronchial tree depending on the lobe. The algorithm uses the following parameters :

	Parameter	Model	Tawhai el al. [39, 105, 106]	Montesantos el al. [67]	Bordas el al. [9]	Published
	Branching Angle
	θ	37.12°± 24.62°3 7;50.31°± 28.92°4 2.10°± 21.40°4 2.89°± 0.10°3 7.28°[34] 39°, 43°[89]
	θ minor	36.72°± 23.65°5 3.00°± 29.02°4	4.67°± 0.10°θ
	major	37.52°± 24.85°4 7.63°± 28.56°3	8.58°± 0.20°R
	atio Length/Diameter
	L D	3.09 ± 1.27	2.92 ± 0.92	3.25 ± 0.52		4.51 ± 0.25	3.06 [49] 3.09, 3.14 [89]
							2.80-3.25 [115]
	L D minor	3.22 ± 1.22	2.88 ± 0.94			4.58 ± 0.25	2.96 ± 0.97 [79]
	L D major	2.99 ± 1.28	2.96 ± 0.90			4.37 ± 0.24	2.71 ± 1.13 [79]
	Assymetry & Reduction factor
	Dminor Dmajor	0.84 ± 0.16	0.81 ± 0.17			0.97 ± 0.00	0.86 [115, 77]
	D D mother	0.78 ± 0.11	0.79 ± 0.15	0.79 ± 0.19		0.82 ± 0.00	0.79 [115] 0.76 [50]
	Dminor D mother	0.70 ± 0.10	0.69 ± 0.06	0.66 ± 0.18		0.81 ± 0.00
	Dmajor D mother	0.85 ± 0.05	0.88 ± 0.14	0.91 ± 0.09		0.85 ± 0.00	0.86 [79]
	Terminal Branches
	Mean						17.60 ± 3.40 [49]
	Terminal	16.61 ± 2.65	16.46	16.20 ± 1.70	15.80 ± 0.47	16 [115]
	Generation						17.60 [34]
	Min-Max Terminal	4 -33	10 -26	8 -25			8 -32 [49] 8 -25 [34]
	Generation

Plane Center = End, Plane Vector = Sister, Branch Direction = Hybrid, Decision Ratio = 0.95, Angle Correction = Activated, Branching Angle Threshold = 96°

Table 3 .

 3 4: Statistical data of the generated trees with branching angle correction and threshold branching angle fixed at 96°. The Hybrid version has a decision ratio at 0.95

	Branch Direction	Min-Max Generation	Mean Generation Terminal	Mean Angle Branching	Asymmetry	Score
	Plane Center : Barycentre | Plane Vector : Mother
	Barycentre	12-16	14.82 ± 0.60	42.68 ± 23.56	0.97 ± 0.02	0.1058
	PoI	12-16	14.83 ± 0.64	32.65 ± 27.44	0.97 ± 0.02	0.0974
	Hybrid	12-16	14.83 ± 0.64	33.22 ± 27.46	0.97 ± 0.02	0.0923
	Plane Center : Barycentre | Plane Vector : Sister
	Barycentre	12-16	14.81 ± 0.59	43.53 ± 23.34	0.97 ± 0.02	0.1135
	PoI	13-16	14.83 ± 0.64	37.29 ± 27.26	0.97 ± 0.02	0.0559
	Hybrid	13-16	14.83 ± 0.64	37.38 ± 27.06	0.97 ± 0.02	0.0569
	Plane Center : PoI | Plane Vector : Mother
	Barycentre	10-29	16.01 ± 2.08	39.33 ± 26.86	0.86 ± 0.13	0.0319
	PoI	9-28	16.49 ± 2.52	33.48 ± 25.42	0.84 ± 0.14	0.0388
	Hybrid	9-28	16.46 ± 2.49	33.56 ± 25.58	0.84 ± 0.14	0.0390
	Plane Center : PoI | Plane Vector : Sister
	Barycentre	10-28	16.20 ± 2.22	39.23 ± 27.10	0.86 ± 0.13	0.0306
	PoI	9-30	16.32 ± 2.31	37.79 ± 27.16	0.85 ± 0.13	0.0125
	Hybrid	9-29	16.33 ± 2.31	37.82 ± 27.17	0.85 ± 0.13	0.0126
	Plane Center : End | Plane Vector : Mother
	Barycentre	13-16	14.83 ± 0.62	42.60 ± 23.71	0.97 ± 0.02	0.1050
	PoI	10-30	16.20 ± 2.37	33.59 ± 25.49	0.84 ± 0.14	0.0380
	Hybrid	10-30	16.15 ± 2.34	33.65 ± 25.44	0.85 ± 0.14	0.0416
	Plane Center : End | Plane Vector : Sister
	Barycentre	11-18	14.92 ± 0.78	43.86 ± 23.17	0.96 ± 0.07	0.1126
	PoI	9-30	16.69 ± 2.70	36.81 ± 24.59	0.82 ± 0.16	0.0113
	Hybrid	9-33	16.61 ± 2.65	37.12 ± 24.62	0.84 ± 0.16	0.0072

Table 3 .

 3 5: Mean morphological parameters of generated trees with branching angle correction with differents threshold branching angle. All models use a cutting plane defined with the sister branch. Models with the hybrid version for branch management use a decision ratio equal to 0.95

	Threshold Angle	Min-Max Terminal Generation	Mean Terminal Generation	Mean Branching Angle	Asymmetry
	Plane Center : Barycentre | Plane Vector : Sister | Branch Direction : Barycentre
	With	12-16	14.81 ± 0.59	43.53 ± 23.34	0.97 ± 0.02
	Without	12-16	14.81 ± 0.59	49.23 ± 29.09	0.97 ± 0.02
	Plane Center : Barycentre | Plane Vector : Sister | Branch Direction : PoI
	With	13-16	14.83 ± 0.64	37.29 ± 27.26	0.97 ± 0.02
	Without	13-16	14.83 ± 0.64	52.30 ± 42.64	0.97 ± 0.02
	Plane Center : Barycentre | Plane Vector : Sister | Branch Direction : Hybrid
	With	13-16	14.83 ± 0.64	37.38 ± 27.06	0.97 ± 0.02
	Without	13-16	14.83 ± 0.64	51.34 ± 41.36	0.97 ± 0.02
	Plane Center : PoI | Plane Vector : Sister | Branch Direction : Barycentre
	With	10-28	16.20 ± 2.22	39.23 ± 27.10	0.86 ± 0.13
	Without	10-28	16.22 ± 2.26	50.56 ± 37.65	0.86 ± 0.13
	Plane Center : PoI | Plane Vector : Sister | Branch Direction : PoI
	With	9-30	16.32 ± 2.31	37.79 ± 27.16	0.85 ± 0.13
	Without	9-26	16.39 ± 2.33	53.99 ± 43.43	0.84 ± 0.14
	Plane Center : PoI | Plane Vector : Sister | Branch Direction : Hybrid
	With	9-29	16.33 ± 2.31	37.82 ± 27.17	0.85 ± 0.13
	Without	9-27	16.40 ± 2.36	53.83 ± 43.24	0.84 ± 0.14
	Plane Center : End | Plane Vector : Sister | Branch Direction : Barycentre
	With	11-18	14.92 ± 0.78	43.86 ± 23.17	0.96 ± 0.07
	Without	12-17	14.87 ± 0.72	49.46 ± 28.88	0.97 ± 0.02
	Plane Center : End | Plane Vector : Sister | Branch Direction : PoI
	With	9-30	16.69 ± 2.70	36.81 ± 24.59	0.82 ± 0.16
	Without	9-32	16.12 ± 2.14	54.38 ± 43.66	0.84 ± 0.13
	Plane Center : End | Plane Vector : Sister | Branch Direction : Hybrid
	With	9-33	16.61 ± 2.65	37.12 ± 24.62	0.84 ± 0.16
	Without	9-30	16.06 ± 2.11	54.14 ± 43.11	0.85 ± 0.13

Table 3 .

 3 .5. 6: Mean morphological parameters of bronchial tree with branching angle correction with differents threshold branching angle. All algorithms use a cutting plane defined with the sister branch. Algorithms with the hybrid version for branch management use a decision ratio equal to 0.95

	Threshold Angle	Min-Max Generation Terminal	Mean Generation Terminal	Mean Angle Branching	Mean Ratio ameter Length/Di-	Asymmetry
	Plane Center : Barycentre | Plane Vector : Sister | Branch Direction : Barycentre
	60	12-16	14.81 ± 0.59	33.37 ± 15.13	3.03 ± 1.13	0.97 ± 0.02
	80	12-16	14.81 ± 0.59	39.06 ± 19.80	3.02 ± 1.15	0.97 ± 0.02
	96	12-16	14.81 ± 0.59	43.53 ± 23.34	3.06 ± 1.15	0.97 ± 0.02
	Plane Center : Barycentre | Plane Vector : Sister | Branch Direction : PoI
	60	13-16	14.83 ± 0.63	30.05 ± 19.05	3.17 ± 1.04	0.97 ± 0.02
	80	13-16	14.83 ± 0.63	34.08 ± 23.03	3.17 ± 1.05	0.97 ± 0.02
	96	13-16	14.83 ± 0.64	37.38 ± 27.06	3.19 ± 1.04	0.97 ± 0.02
	Plane Center : Barycentre | Plane Vector : Sister | Branch Direction : Hybrid
	60	12-16	14.83 ± 0.63	30.06 ± 19.33	3.16 ± 1.04	0.97 ± 0.02
	80	13-16	14.83 ± 0.64	33.76 ± 23.21	3.15 ± 1.05	0.97 ± 0.02
	96	13-16	14.83 ± 0.64	37.29 ± 27.26	3.18 ± 1.04	0.97 ± 0.02
	Plane Center : PoI | Plane Vector : Sister | Branch Direction : Barycentre
	60	10-27	16.21 ± 2.27	31.71 ± 20.37	3.08 ± 1.15	0.86 ± 0.13
	80	10-30	16.20 ± 2.23	35.52 ± 23.49	3.09 ± 1.16	0.86 ± 0.13
	96	10-28	16.20 ± 2.22	39.23 ± 27.10	3.11 ± 1.14	0.86 ± 0.13
	Plane Center : PoI | Plane Vector : Sister | Branch Direction : PoI
	60	9-28	16.27 ± 2.26	30.56 ± 20.47	3.11 ± 1.10	0.86 ± 0.13
	80	9-32	16.35 ± 2.38	33.90 ± 23.73	3.13 ± 1.12	0.85 ± 0.13
	96	9-29	16.33 ± 2.31	37.82 ± 27.17	3.16 ± 1.13	0.85 ± 0.13
	Plane Center : PoI | Plane Vector : Sister | Branch Direction : Hybrid
					Continued on next page ->

Table 3 .

 3 7: Mean morphological parameters of bronchial tree with branching angle correction with differents threshold branching angle. All models use a cutting plan defined with the sister branch. Models with the hybrid version for branch management use a decision ratio equal to 0.95

	Decision Ratio	Min-Max Terminal Generation	Mean Terminal Generation	Mean Branching Angle	Asymmetry	Percentage Barycentre
	0	11-21	14.93 ± 0.81	43.96 ± 23.10	0.96 ± 0.07	99.74%
	0.05	11-21	14.93 ± 0.81	43.95 ± 23.10	0.96 ± 0.07	99.71%
	0.1	11-26	14.94 ± 0.86	43.96 ± 23.10	0.96 ± 0.07	99.67%
	0.15	11-27	14.95 ± 0.89	43.87 ± 23.13	0.96 ± 0.07	99.64%
	0.2	11-31	14.98 ± 0.98	44.30 ± 22.84	0.96 ± 0.07	99.60%
	0.25	11-31	14.98 ± 0.98	44.29 ± 22.83	0.96 ± 0.07	99.56%
	0.3	11-31	14.98 ± 0.99	44.24 ± 22.87	0.96 ± 0.07	99.52%
	0.35	11-26	15.05 ± 1.16	43.99 ± 23.03	0.96 ± 0.07	99.49%
	0.4	11-26	15.05 ± 1.16	44.01 ± 23.02	0.96 ± 0.07	99.47%
	0.45	11-26	15.06 ± 1.20	44.06 ± 22.94	0.96 ± 0.07	99.35%
	0.5	11-29	15.09 ± 1.28	44.06 ± 22.91	0.96 ± 0.07	99.23%
	0.55	11-29	15.10 ± 1.30	43.95 ± 22.97	0.96 ± 0.08	99.03%
	0.6	11-27	15.13 ± 1.33	43.82 ± 23.03	0.96 ± 0.08	98.88%
	0.65	10-29	15.36 ± 1.87	42.99 ± 23.41	0.96 ± 0.09	98.21%
	0.7	10-28	15.53 ± 1.94	41.97 ± 23.79	0.95 ± 0.10	96.24%
	0.75	10-31	15.71 ± 2.11	41.32 ± 23.82	0.93 ± 0.11	92.03%
	0.8	10-30	15.93 ± 2.21	39.78 ± 24.28	0.91 ± 0.14	83.61%
	0.85	9-33	16.36 ± 2.58	38.30 ± 24.53	0.88 ± 0.15	72.38%
	0.9	9-30	16.53 ± 2.63	37.21 ± 24.61	0.85 ± 0.16	61.44%
	095	9-33	16.61 ± 2.65	37.12 ± 24.62	0.84 ± 0.16	51.40%
	1	9-30	16.69 ± 2.70	36.80 ± 24.58	0.82 ± 0.16	0%

Table 3 .

 3 Table of the others morphological parameters 8: Other mean morphological parameters for the default algorithm.

	Structure	L D	Lminor Dminor	Lmajor Dmajor
	Left Lobes
	Lower	3.02 ± 1.29	3.16 ± 1.25	2.91 ± 1.30
	Upper	3.11 ± 1.27	3.26 ± 1.21	2.99 ± 1.28
				Continued on next page ->

Table 3 .

 3 9: Other mean morphological parameters of bronchial tree for the different. Algorithms with the hybrid version for branch management use a decision ratio equal to 0.95. All the algorithms use the branching angle correction with a branching angle threshold at 96°

Table 4 .

 4 1: Lung and air volumes of an average person, Jacques Mayol and an average breath-hold diver.

		.54 L	7.22 L	9.59 L
	V a,frc	3.31 L	3.67 L	4.87 L
	V a,rv	1.73 L	1.88 L	1.79 L
	Lung Volumes
	V l,tlc	6.91 L	7.63 L	10.13 L
	V l,frc	3.68 L	4.07 L	5.41 L
	V l,rv	2.10 L	2.29 L	2.33 L
	Other Volumes
	V t	0.37 L	0.41 L	0.54 L
	V lung packing			1.9 L
	V reverse packing			0.38 L
	V l,tlc + V lung packing			12.03 L
	V l,rv -V reverse packing			1.95 L

Table 4 .

 4 2.

	Volume of the CT-Scan data
	V a,tlc	6.15 L	V l,tlc	6.50 L
	V a,frc	3.16 L	V l,frc	3.47 L
	V a,rv	1.54 L	V l,rv	1.88 L
	V t	0.35 L

Table 4 . 2

 42

: Lung and air volumes of the CT-Scan data.

Remerciements

For our algorithm, we have defined the size limit H lim as a function of the size of the bounding box H Bbox as :

The 256 ratio limits calculation times while maintaining a good accuracy.

Definition of the initial direction of the branch

In the Tawhai et al. model, the branch direction is defined using the end of its parent branch and the barycentre of the associated volume but, as we explained earlier, in some non-convex volumes, this barycentre can be outside the cell or too close to the edges of the cell. In the case of non-convex volumes, the branches from the following steps are likely to be badly positioned, which results in non-physiological configurations. To avoid this situation, we have at our disposal the barycentre and PoI of the closed surface mesh. We will then calculate the signed distances of the barycentre and PoI from the mesh and compare these two values. If the signed distance of the barycentre is greater than a certain the product of a ratio with the signed distance of the PoI, we will then define the direction of the branch using the end of its parent branch and the barycentre, otherwise we use the PoI. To determine this ratio, which we will call the decision ratio and noted r d , we generated several bronchial trees by adjusting the value of the decision ratio. The results, we present in the following, show that the decision ratio allowing a good balance in decision-making is for r d = 0.95. In the following we use this direction to calculate the branch angle which, depending on its value, will allow us to correct the direction of the branch to obtain a correct branch angle. After this, the length and diameter of the branch can be defined. Notice that, practically, in the code developed for this work, the user can choose to define the initial direction of the branch using only the barycentre or only the PoI or by adjusting the value of the decision ratio.

Diameter

In both Tawhai et al. and Kitaoka et al. algorithms, this variable is defined according to the diameter of the mother branch.

In Tawhai et al. algorithm, the calculation uses the Homothety Ratio (HR) [START_REF] Merryn | Developing integrative computational models of pulmonary structure[END_REF][START_REF] Howatson Tawhai | Generation of an anatomically based three-dimensional model of the conducting airways[END_REF][START_REF] Bordas | Development and Analysis of Patient-Based Complete Conducting Airways Models[END_REF][START_REF] Montesantos | The Creation and Statistical Evaluation of a Deterministic Model of the Human Bronchial Tree from HRCT Images[END_REF], that relates the diameter of the daughter branch to the diameter of its mother branch :

Kitaoka et al. proposed to compute the diameter using Murray's law [START_REF] Murray | The Physiological Principle of Minimum Work[END_REF]:

(3.10) with r = V child V mother which corresponds to the ratio of the mesh volumes associated with the parent and daughter branches. The value of the variable n is set by Kitaoka et al. to 2.8.

Murray's law arises from a fluid network optimisation process, which applies to the lung geometry [START_REF] Mauroy | An optimal bronchial tree may be dangerous[END_REF]. Hence, we used the computation proposed by Kitaoka et al.. This difference in growth is explained by the fact that the residual volume of Jacques Mayol is greater than that of an average person. The blood volume necessary for Jacques Mayol to reach 70 msw was estimated at 980 ml according to the first models, in full accordance with our model that predicts 975 ml of blood supply. For the average breath-hold diver, the use of the "Reverse Packing" technique reduces the residual volume. This reduction in residual volume delays the onset of blood supply, resulting in lower values than in other studies.

Accounting for tissue mechanical pressure

Model to predict volumes

In the previous section, we assumed that the hydrostatic pressure p w is in equilibrium with the air pressure in the lungs p a . In this section we assume that another pressure enters the pressure equilibrium, the tissue mechanical pressure p t . Thus, the equation 4.7 becomes :

The equations 4.4 and 4.6 remain unchanged. From the tissue mechanical pressure p t , we can define the other parameters of this model. The depth at which the athlete is located during the simulation is defined by :

We denote z → p t (z) the inverse function of the function p t → z(p t ), we can then define the volume of the air, the pressure of the air and the blood shift volume by :

However, these equations are only valid for a depth below the critical depth, i.e. z < z c . For z >= z c , the blood shift occurs : V l = V c l and p t = p c t . We then have the following model: by a weighted sum of evaluations of the function at a certain number of points (quadrature point) of the integration domain. We will start by decomposing the integrals on Ω into a sum of integrals on the cells :

where K refers to a cell, and T ≈ Ω is a mesh approximating the domain. This will give with the quadrature of each cell :

where x K q is the q-th quadrature point on cell K, and w K q the q-th quadrature weight. We will then perform a loop on each cell of the mesh, on each degree of freedom of a cell and on each quadrature point to calculate the contribution of this cell to the matrix of the linear Young's modulus E can be defined as a function of K and ν with E

, with ν = 0.4, we have :

The starting point for this new model is the displacement equations when taking into account the ribs: