Segmentation and reconstruction of the lung and the mediastinum volumes in CT images