Skip to main content
. 2023 Feb 14;23(4):2147. doi: 10.3390/s23042147
Algorithm 2: NHBCC Algorithm
Input: ASSRG segmented lobe (right or left) (J), the width of the line (n)
Output: Border-corrected lung lobe (Ibcl)
  1. Add ‘n’ columns of zeros to the ‘J’ at the left and right sides to enhance the efficacy of boundary identification.

  2. Apply a morphological opening function to eliminate unsolicited objects from the image.

  3. Morphologically rebuild based on the flood-fill function to fill the holes in the images.

  4. Normalize the shape of the image using MF.

  5. Implement associated component analysis.

  6. Determine the number of linked regions (N).

  7. for j = 1:N

    Compute the area (j) of every associated region

    end

  8. Mine the associated region (Iar) that has the supreme area % of lobe area.

  9. Determine the indices of ‘Iar’ that are genuinely intense and save them as φ=(x(i), y(i)), where ‘i’ is the number of locations with true intensity.

  10. Implement the revealing boundary algorithm with ‘φ’ indexes set, which produces a collection of edge indices (χ). % negates minor deep concave indices.

  11. Implement a convex hull algorithm with ‘φ’ indexes set that produce a collection of edge indices (£). % negates massive deep concave indices.

  12. Generate new index set ‘s’ by linking ‘χ’ and ‘£’ indices (if identical indices, preserve a duplicate).

  13. Link indices (s) with line width ‘n’ that wholly includes a lobe deprived of concavities.

  14. Apply CE to the outcome of step 10 and detect boundaries.

  15. Redo steps 5 to 7.

  16. Mine the linked area that has the smallest area (I_min). % (Inner lobe boundary deprived of highly segmented external soft wall)

  17. The internal area of ‘I_min’ is made intense. Eliminate the intentionally added columns of zeros in step 1.

  18. Return the border-corrected lobe region (Ibcl).