# Semi-Automatic Segmentation of Vertebral Bodies in MR Images of Human Lumbar Spines
## 2 Materials and Methods
### Segmentation  
During the ROI fine tuning process, we can determine the approximate position of the vertebral body boundary. \[\mathrm{bL}=\underset{\mathrm{i}}{argmax}\Big{(}\mathbf{Px}\Big{(}1<\mathrm{i }<\frac{\mathrm{lv}}{2}\Big{)}\Big{)} \tag{1}\]  
\[\mathrm{bR}=\underset{\mathrm{i}}{argmax}\Big{(}\mathbf{Px}\Big{(}\frac{ \mathrm{lv}}{2}<\mathrm{i}\leq\mathrm{lv}\Big{)}\Big{)} \tag{2}\]  
\[\mathrm{bU}=\underset{\mathrm{i}}{argmax}\Big{(}\mathbf{Py}\Big{(}1<\mathrm{j }<\frac{\mathrm{lv}}{2}\Big{)}\Big{)} \tag{3}\]  
\[\mathrm{bD}=\underset{\mathrm{i}}{argmax}\Big{(}\mathbf{Py}\Big{(}\frac{ \mathrm{lv}}{2}<\mathrm{j}\leq\mathrm{ly}\Big{)}\Big{)} \tag{4}\]  
where \((\mathrm{bL},\mathrm{bU}),(\mathrm{bR},\mathrm{bU}),(\mathrm{bL},\mathrm{bD})\), and \((\mathrm{bR},\mathrm{bD})\) are approximate vertices of the vertebral body boundary. Then, we draw lines connecting each dot at points spaced inward and outward from the approximate vertices, as shown in Figure 3a. Using these points, the vertebral body ROI is divided into eight areas, as illustrated in Figure 3b, and different segmentation methods are applied to these areas. Figure 4 shows the flowchart of the segmentation process. Areas \(\mathbf{U}\) and \(\mathbf{D}\) detect boundaries using the graph-cut based method. \(\mathbf{U}\) and \(\mathbf{D}\) are converted to graph \(\mathbf{G}~{}=~{}(\mathbf{V},\mathbf{E})\). As \(\mathbf{G}\) should be divided into the top and bottom, the nodes \(\mathbf{n}\in\mathbf{V}\) and edges \(\mathbf{e}\in\mathbf{E}\) are set along the x-axis. Intervals between each pixel along the x-axis are set to the nodes \(\mathbf{n}\in\mathbf{V}\) and pixel intensities between the nodes are set to the edges \(\mathbf{e}\in\mathbf{E}\)[25]. As a result, boundaries that can properly distinguish the top and bottom in the x-direction of \(\mathbf{U}\) and \(\mathbf{D}\) are detected. Because \(\mathbf{L}\) and \(\mathbf{R}\) contain the background, applying the graph-cut to find the minimum route is difficult. In this case, segmentation is performed by capturing boundary points for each line of the ROI. First, k-means clustering is performed to divide the total ROI into 10 clusters. Let \(\mathbf{YL}\) be the clustered \(\mathbf{L}\), whose size is \((\mathrm{lv},\,\mathrm{ly})\) and \(\mathbf{YL}_{\mathrm{i}}\) be the i-th line of \(\mathbf{YL}\). At this time, the base value \(\mathrm{BL}_{\mathrm{i}}\) is ly or the peak point nearest to ly, and the reference value \(\mathrm{RL}_{\mathrm{i}}~{}=~{}ceil(\mathbf{YL}_{\mathrm{i}}(\mathrm{BL}_{ \mathrm{i}})/2)\). \(\mathbf{YL}_{\mathrm{i}}\) can be divided into three cases. Case 1 has one or more deep valleys and peaks between \(\mathrm{BL}_{\mathrm{i}}\) and 1, and the peak value far from  
Figure 3: Partitioning area. (**a**) Pointing base vertices. (**b**) Partitioned area. \(\text{BL}_{i}\) is larger than \(\text{RL}_{i}\). Case 2 is similar to the case 1, but the peak values are smaller than \(\text{RL}_{i}\). Case 3 is the case without a valley. For each case, the boundary point \(\text{EL}_{i}\) is as follows:  
\[\text{Case 1}:\ \text{EL}_{i}\ =\underset{j}{argmin}(\mathbf{Y}\mathbf{L}_{i}( \text{PL}_{i}<\text{j}<\text{ly})) \tag{5}\]  
\[\text{Case 2},3:\ \text{EL}_{i}\ =\ \text{ML}_{i} \tag{6}\]  
\(\text{PL}_{i}\) denotes the peak point closest to \(\text{BL}_{i}\) which has a valley smaller than \(\text{RL}_{i}\) towards \(\text{BL}_{i}\) and having a larger value than the valley by 2 cluster stages or more. \(\text{ML}_{i}\) is the point closest to \(\text{BL}_{i}\) among the points having the value of \(ceil(\mathbf{Y}\mathbf{L}_{i}(\text{BL}_{i})/3)\). The case of region **R** is similar to the case of **L**, but performed in the opposite direction. **YR** is the clustered **R**, whose size is \((\text{rx},\ \text{ry})\) and let \(\mathbf{Y}\mathbf{R}_{i}\) be the i-th line of **YR**. \(\text{BR}_{i}\) is 1 or the peak point nearest to 1, and the reference value \(\text{RR}_{i}\ =\ ceil(\mathbf{Y}\mathbf{R}_{i}(\text{BR}_{i})/2)\).