Research Article

A Framework of Vertebra Segmentation Using the Active Shape Model-Based Approach

Algorithm 2

RecursiveFunction ( 𝑆 𝑖 ) .
Input:
 (i)  𝑆 𝑖 : a sequence of 𝑖 points
Data:
  (i)  𝐿 : the set of all the detected points
  (ii) 𝑙 𝑖 : the last point in the sequence 𝑆 𝑖
  (iii) 𝑉 : a set of sequences composed by 2 𝑁 points
  (iv) 𝛼 : the height of a vertebra
  (v) 𝛽 : the size of an intervertebral space
begin
   if 𝑖 = 2 𝑁 βˆ’ 1   then
   Add 𝑙 2 𝑁 to 𝑆 𝑖 ;
   Add 𝑆 𝑖 to 𝑉 ;
   return;
  else
   if 𝑙 𝑖   is an upper corner then
      foreach 𝑙   in 𝐿   do
      if 𝛼 βˆ’ 𝛿 𝛼 < 𝑑 𝑖 𝑠 𝑑 ( 𝑙 𝑖 , 𝑙 ) < 𝛼 + 𝛿 𝛼   then
       Remove 𝑙 from 𝐿 ;
        𝑆 𝑖 + 1 = 𝑆 𝑖 βˆͺ 𝑙 ;
        𝑅 𝑒 𝑐 𝑒 π‘Ÿ 𝑠 𝑖 𝑣 𝑒 𝐹 𝑒 𝑛 𝑐 𝑑 𝑖 π‘œ 𝑛 ( 𝑆 𝑖 + 1 ) ;
   else
     foreach 𝑙   in 𝐿   do
       if 𝛽 βˆ’ 𝛿 𝛽 < d i s t ( 𝑙 𝑖 , 𝑙 ) < 𝛽 + 𝛿 𝛽   then
        Remove 𝑙 from 𝐿 ;
         𝑆 𝑖 + 1 = 𝑆 𝑖 βˆͺ 𝑙 ;
         𝑅 𝑒 𝑐 𝑒 π‘Ÿ 𝑠 𝑖 𝑣 𝑒 𝐹 𝑒 𝑛 𝑐 𝑑 𝑖 π‘œ 𝑛 ( 𝑆 𝑖 + 1 ) ;