This notebook provides a minimal working example of LungMask, a tool for the segmentation of the the lungs and the lung lobes from non-contrast CT images robust to the presence of severe pathologies. In particular, in this notebook we make use the fusion between the results of the R231 and LTRCLobes models.
We test LungMask by implementing an end-to-end (cloud-based) pipeline on publicly available chest CT scans hosted on the Imaging Data Commons (IDC), starting from raw DICOM CT data and ending with a DICOM SEG object storing the segmentation masks generated by the AI model. The testing dataset we use is external and independent from the data used in the development phase of the model (training and validation) and is composed of a wide variety of image types (from image acquisition settings, to the presence of a contrast agent, to the presence, location and size of a tumor mass).
The way all the operations are executed - from pulling data to data postprocessing and the standardisation of the results - have the goal of promoting transparency and reproducibility.
Please cite the following article if you use this code or pre-trained models:
Hofmanninger, J., Prayer, F., Pan, J. et al. Automatic lung segmentation in routine imaging is primarily a data diversity problem, not a methodology problem. Eur Radiol Exp 4, 50 (2020). https://doi.org/10.1186/s41747-020-00173-2.
Original code: GitHub
The original code as well as this notebook is published using the Apache-2.0 license.