Segment lungs from CT images using threshold and morphological operations
- Load a lung 3D CT scan
- Plot a selected 2D slice
- Normalise image intensities:
- stretch intensity values distribution using percentiles
- standardise around mean value
- rescale [0-255]
- Mask the body:
- region growing
- morphological operations
- connected components
- Mask the lung:
- threshold
- morphological operations
- connected components
- The algorithm works fine for most of the cases
- If the right and left lung are connected, they may get segmented as one label (2-3 cases)
- It can miss infected lesions that appears with different intensity values than the lung's
- It won't work on bad converted nifti images from dicom, because of the weird intensity distribution