(1) | procedure LungVolumeExtraction(input image, low, high) //beginning lung vol. extraction algorithm |
(2) | I ⟵ input image //input image |
(3) | O ⟵ Ø, Lo ⟵ low, Hi ⟵ high //output image, low and high threshold |
(4) | DIm ⟵ Converting (I, double) //converting image to double image |
(5) | for (i ϵ row length of DIm) //starting loop of extraction step |
(6) | for (j ϵ column length of DIm) //starting of inner loop |
(7) | if DIm(i, j) ≥ Lo and DIm(i, j) ≤ Hi then //starting of if |
(8) | DIm(i, j) ⟵ 1; //assignment of binary 1 |
(9) | else |
(10) | DIm(i, j) ⟵ 0; //assignment of binary 0 |
(11) | end if //ending of if |
(12) | end for //ending of inner loop |
(13) | end for //ending loop of extraction step |
(14) | BI ⟵ Converting(DIm, binary) //converting image to binary image |
(15) | FI ⟵ Morphological eroding, dilating, filling (BI) //morphological operations |
(16) | GIm ⟵ Converting(FI, gray-scale) //converting image to gray-scale image |
(17) | O ⟵ GIm //return output image |
(18) | end procedure //ending of LUVEM method |