Open access peer-reviewed chapter

OncoSpineSeg: A Software Tool for a Manual Segmentation of Computed Tomography of the Spine on Cancer Patients

Written By

Silvia Ruiz-España and David Moratal

Submitted: November 29th, 2016 Reviewed: March 15th, 2017 Published: August 9th, 2017

DOI: 10.5772/intechopen.68552

Chapter metrics overview

1,437 Chapter Downloads

View Full Metrics


The organ most commonly affected by metastatic cancer is the skeleton, and spine is the site where it causes the highest morbidity. Computer-aided diagnosis (CAD) for detecting and assessing metastatic disease in bone or other spine disorders can assist physicians to perform their decision-making tasks. A precise segmentation of the spine is important as a first stage in any automatic diagnosis task. However, it is a challenging problem to segment correctly an affected spine, and it is a crucial step to assess quantitatively the results of segmentation by comparing them with the results of a manual segmentation, reviewed by one experienced radiologist. This chapter presents the design of a MATLAB-based software for the manual segmentation of the spine. The software tool has a simple and easy to use interface, and it works with either computed tomography or magnetic resonance imaging (MRI). A typical workflow includes loading the image volume, creating multi-planar reconstructions, manually contouring the vertebrae, spinal lesions, intervertebral discs and spinal canal with availability of different segmentation tools, classification of the bone into healthy bone, osteolytic metastases, osteoblastic metastases or mixed lesions, being also possible to classify an object as a false-positive and a 3D reconstruction of the segmented objects.


  • computed tomography
  • magnetic resonance imaging
  • manual segmentation
  • metastatic disease
  • spinal canal
  • intervertebral discs
  • vertebrae

1. Introduction

Spine is a structure commonly involved in several prevalent diseases causing, in most of the cases, back pain [1]. Back pain is an important public health problem in industrialized countries [1], and it is a common cause of disability, activity limitation, work absenteeism and economic burden [2].

Moreover, spinal metastases affect many patients with advanced cancer since the bone is the most common spot of metastatic recurrence and the spine the most frequent place of bone metastases [3]. Bone metastasis is typically referred as osteolytic or osteoblastic. Osteolytic or lytic lesions are associated with bone resorption; there is a scarce new bone formation and focal bone destruction. Osteoblastic or blastic lesions are associated with an increased osteoblastic activity; these lesions seem to have little or no resorptive component. The structure of the new bone grows abnormally and causes the bone to be weak [4]. Metastatic spine is prone to several complications such as fractures and spinal cord compression due to weakness [4, 5].

Nowadays, spinal imaging studies are increasing worldwide [6], and computer-aided diagnosis (CAD) is beginning to be a part of the routine clinical work, being applied in the detection and differential diagnosis of abnormalities. Hence, its demand over the past decade has increased as a way to assist radiologists in the imaging diagnosis of back pain [7, 8]. Automatic reliable methods to quantify and classify spinal disorders, and an early detection of metastatic disease to prevent complications, are an unmet need. However, an accurate segmentation of the spine is an essential step prior to any diagnosis task. For this reason, considerable research effort has been directed towards the development of automatic or semi-automatic algorithms for the segmentation of the spine in computed tomography (CT) or magnetic resonance imaging (MRI) [9]. There are methods that do not include prior information in the process of segmentation as this kind of data is not always available. These algorithms mainly rely on the information extracted from the acquired images, for example, the application of intensity thresholds, watershed, level-set and direct graph methods [1013]. However, other methods incorporate higher-level knowledge of the object of interest to facilitate or improve the segmentation results. Most of them are based on deformable models [1417]. For example, using an active shape model, a statistical representation of the object is performed. The active shape model is used to identify objects, within other images, considered as the same class by using landmark points [18, 19]. Some algorithms also integrate image patches, such as intensity or texture, into the statistical model. These methods are known as active appearance models [20]. Using an atlas-based segmentation is also a way to introduce anatomical information related to the position of an organ [2123]. The raw data values that are stored in an image are not always sufficiently informative, especially in the case of organs whose limit surface is not clearly defined in terms of signal value. In these cases, the only way to classify appropriately a voxel is taking into account its spatial location, either in absolute co-ordinates or, more commonly, given its spatial relationship with other already segmented structures. This is exactly the kind of information that can be provided by an atlas.

Unfortunately, the segmentation process involves four image-related problems. They are partial volume effect, intensity inhomogeneity, intensity similarity and noise. These problems and the differences in body structures among individuals make the segmentation process a very challenging task. Therefore, in order to obtain an accurate and robust segmentation, it is a crucial step to assess quantitatively the results of segmentation by comparing them with the results of a manual segmentation, made by experts. Some free softwares developed for image analysis or as automatic (semi-automatic) medical image segmentation tools can be also used for manual segmentation. For instance, Heilberg et al. developed a cardiovascular image analysis software package called segment. The main features of this software include loading Digital Imaging and Communications in Medicine (DICOM) images from all major MRI vendors, display of multiple image stacks at the same time, automated segmentation of the left ventricle, flow quantification, region of interest analysis, myocardial viability analysis and image fusion tools. The software also incorporates all the necessary tools to perform a manual segmentation [24]. Casero et al. developed a new spline tool for the open source software platform Seg3D [25] in order to perform the manual segmentation of the annulus of the cardiac valves. In this work, they review two manual segmentation approaches, slice-by-slice and manual segmentation interpolating a sparse set of landmarks [26]. However, these softwares are mainly focused on cardiovascular image analysis.

In this chapter, we present a software tool for performing the manual segmentation of vertebrae, intervertebral discs, spinal metastases and spinal canal. To the best of our knowledge, there is no free software for the manual segmentation of the spine. For this reason, it has been designed to get references with which users can compare automatic segmentations. The software tool can be divided into six main modules, and a general approach is shown in Figure 1.

Figure 1.

General approach of the manual segmentation software developed. After loading a 3D image volume, a multi-planar reconstruction from the original axial planes is performed. Next, it is necessary to label the structure to be segmented. Segmentation can be performed in any of the three views and in two different ways. Following segmentation, it is possible to classify the segmented bone. Finally, a 3D reconstruction can be obtained.


2. Software description

2.1. Software platform and data

The software tool presented in this work is called OncoSpineSeg, and its main interface is shown in Figure 2. The graphical user interface and all the implemented functions have been developed under MATLAB 7.10 (R2010a) (The Mathworks, Inc., Natick, MA, USA). Using MATLAB, the code can be written in a straightforward manner, which allows easily modifying, extending or integrating new functions. It can be executed under Windows, Linux or Mac OS.

Figure 2.

Main interface of OncoSpineSeg. (a) To load the 3D data volume, a saved segmentation, or to perform a 3D reconstruction. (b) To prepare images for segmentation and to perform manual segmentation. (c) To get information about the objects, which have been already segmented. (d) To copy and paste different objects and to edit the contour or label of a segmented object. (e) Multi-planar reconstruction. The straight vertical and horizontal lines are the position markers. (f) To label the structure to be segmented. (g) To classify the segmented bone (‘textures’ menu). There are three different options for the representation of the segmented objects, and there is information about the texture patterns associated with the different bone types available in the ‘textures’ menu.

The software has been tested with CT imaging and also with MRI. Both modalities are widely used for the diagnosis of spinal disorders. MRI is the preferred modality for the diagnosis of intervertebral disc pathology and spinal stenosis because it provides better contrast resolution to differentiate soft tissues [27, 28]. However, bony structures are more clearly identified in CT scans being possible to distinguish between cortical and trabecular bones and allowing accurate diagnosis of vertebral lesions [29].

The software supports the classical formats encountered in medical applications, e.g. DICOM, Neuroimaging Informatics Technology Initiative (Nifti), Raw, Meta-Image or the Visualization Toolkit (VTK). When 3D data are loaded, relevant information such as image data, resolution, acquisition details or patient identification is stored as a structure to be included in the final segmentation output file. The final output file will also contain the manual segmentation.

After loading a 3D image volume, a multi-planar reconstruction (MPR) is performed. Sagittal and coronal cross sections are reconstructed from original axial planes. In this way, it allows an easy and a fast mutual cross-correlation of any object with the other views. The software has available position markers that allow the user to move through the volume data only by clicking with the mouse button at the desired position over any of the three planes. It is also possible scrolling between image slices using a set of sliders.

The software tool allows loading a second dataset. That is, it is also possible to load a saved segmentation in order to easily fix mistakes, using the editing tool, or finish an incomplete segmentation. This will be explained in Section 2.3.

2.2. Tools for image segmentation preparation

In spite of high contrast of MRI and CT images, there are often unclear object boundaries or similar structures in close vicinity, which impede obtaining an exact segmentation.

Classic image processing tools have been developed to facilitate manual segmentation. By using these tools, it is possible to adjust image details such as contrast and brightness or to zoom into specific regions of the image, according to mouse movements. Zoom is applied to all sections, axial, sagittal and coronal, at the same time.

Position markers are also useful for image preparation because they allow users to move between image slices and select the most appropriate region to segment each structure.

2.3. Slice-by-slice manual segmentation

Prior to start manual segmentation, a mandatory first step is to label the structure, which is going to be segmented. If the structure is not labelled, the process of manual segmentation will not be available and the user will receive information about how to proceed. In the presented tool, there is a module for this purpose, which opens up an anatomical image displaying the anterior and lateral views of an artificial spine. Only by clicking on the vertebra, we want segmentation of the specific label to be automatically set. It is also possible to select a label for the intervertebral discs and the spinal canal. A ‘NO LABEL’ label can also be used, allows segmenting a structure without any specific information. A default colour is assigned to each one of the available labels, although these colours can be changed. Any performed change will be stored and saved with the segmentation results.

There are two ways to manually segment the structures, and, in both cases, it is possible to segment in any of the three views (axial, sagittal and coronal), shown in Figure 1. In the first way, the region of interest is specified by placing a set of points using the mouse. Once the regions have been specified, they can interactively be dragged, or resized by deleting or adding new points. Then, the set of points is interpolated with a spline curve. In the second way, the region of interest is manually drawn, as using a pencil. To facilitate the segmentation task, the software permits the user to copy one or several contours and paste them upwards and downwards through the slices. The user has the possibility of using the editing tool, anytime, to edit any contour, as well as its label, to accommodate them to a more precise segmentation or to change its identification. If it is necessary to perform the segmentation again, it is possible to undo the last segmentation or delete all or just some specific contours.

The segmented objects are shown in all three views: axial, sagittal and coronal. In the axial view, it is only possible to see the segmentations performed in the current slice. However, in the sagittal and coronal views, the segmentations performed in all other slices are shown at the level indicated by the markers. An example of slice-by-slice segmentation of the vertebrae and the spinal canal in CT images is shown in Figure 3.

Figure 3.

(a) Manual segmentation of a slice corresponding to the vertebra L3 and to the spinal canal. (b) and (c) show the corresponding slices to the vertebra for the sagittal and coronal views, respectively, as selected by the markers.

Another example of manual segmentation is shown in Figure 4. In this case, all intervertebral discs of the lumbar region have been segmented in MRI.

Figure 4.

(a) Manual segmentation of a slice corresponding to the intervertebral disc L5-S1 in the axial view of an MR image. (b) Shows the segmentation of all lumbar intervertebral discs in the sagittal view. External contours are shown with a solid line.

The software offers, constantly, information about the objects segmented in the current slice and the objects already segmented within the whole volume. Mask values and labels are already accessible after segmentation. All masks corresponding to the segmented objects are stored in a volume data. As stated previously, the structure of the final file has different fields for storing important information. Details such as image data, spatial resolution, acquisition details, patient identification and user’s name, besides all previously reported segmentation data (masks, labels and colours assigned to each label), will be stored as a .mat.

2.4. Bone classification

Once the segmentation of the structures has been performed, it is possible to classify the segmented bone. In the right side of the software interface, a menu called ‘textures’ is available. This menu permits to categorize the bone into healthy bone (default mode), osteolytic metastases, osteoblastic metastases or a mixture of osteolytic and osteoblastic lesions. It is also possible to classify an object as a false-positive (i.e. osteophytes).

According to the selected bone lesion, different texture patterns are applied, as shown in Figure 5. In addition, in the right side of the software interface, a panel called ‘texture description’ can be found where there is information about the textures associated with the different available bone types. In this way, the user can easily differentiate among the different spinal lesions.

Figure 5.

(a) Manual segmentation of a slice corresponding to the vertebra L4 and to the spinal canal. The striped region corresponds to an osteolytic metastasis. The segmentation of all the slices corresponding to the vertebra L4 is shown in the point indicated by the markers, in sagittal section (b) and coronal section (c).

There are different ways to visualize the structures, which have been segmented and classified. A menu called ‘image representation’ is available for this purpose. Inside the menu there are three visualization options: selecting ‘external contours’ allows to show only the segmentation of the spine without any lesion, ‘texture contours’ permits us to visualize the segmentation contour of the spine and all the spinal lesions and, finally, ‘solid objects’ allows to depict segmentation of the spine and the spinal lesions with their corresponding texture patterns.

At this point, a complete spine segmentation has been performed, and it can be used as a reference to assess the accuracy of automatic segmentation methods, or to evaluate metastatic involvement.

2.5. 3D reconstruction

3D reconstruction provides accurate information of the 3D structure of the whole spine, which can be very important as some clinical applications often use some parameters obtained from these 3D reconstructions.

The software uses a volume rendering algorithm to reconstruct an isosurface from the volumetric dataset containing the segmentation results. It also smooths the resulting isosurfaces, applies a colour, which corresponds to colours assigned during labelling, and displays the 3D object. The resulting image can be easily rotated, zoomed or saved. An example of a 3D reconstruction is shown in Figure 6.

Figure 6.

(a) 3D reconstruction of a whole spine with a spinal metastasis. The vertebra with the circle is zoomed in (b) and (c) where a metastasis can be distinguished (arrow).


3. Conclusions and future work

A software tool called OncoSpineSeg has been presented. This tool permits to manually segment an MRI or CT dataset, showing vertebral bodies, spinal metastases, intervertebral discs and spinal canal.

OncoSpineSeg has been fully developed using MATLAB in a straightforward manner, which allows the user not only modify or integrate new functions but also easily adapt the software to detect other spinal lesions or segment other structures. All the needed tools to facilitate the workflow have been implemented, such as the contour editing mode to fix mistakes or redraw inaccurate contours without the necessity of drawing again the complete contour. In addition, it offers a simple, intuitive and easy to use interface.

Slice-by-slice segmentation is a time-consuming process. However, it is widely known the importance of having image sets, manually segmented by experts, for reference. For this reason, and in order to facilitate the advance of research on this topic, we expect to share OncoSpineSeg through internet under a free to download open source license. We also expect to provide a database of several spine CT volumes and the manual segmentation of the vertebral bodies and spinal canal. In addition, OncoSpineSeg will be also available in source code to allow modifications and extensions.



The authors thank the financial support of the Spanish Ministerio de Economía y Competitividad (MINECO) and the FEDER funds under Grants TEC2012-33778 and BFU2015-64380-C2-2-R. The authors thank Dr. Estanislao Arana for his collaboration.


  1. 1. Loney PL, Stratford PW. The prevalence of low back pain in adults: A methodological review of the literature. Physical Therapy. 1999;79:384-396
  2. 2. Hoy D, Brooks P, Blyth F, Buchbinder R. The epidemiology of low back pain. Best Practice and Research Clinical Rheumatology. 2010;24(6):769-781. DOI: 10.1016/j.berh.2010.10.002
  3. 3. Oliveira MF, Rotta JM, Botelho RV. Survival analysis in patients with metastatic spinal disease: The influence of surgery, histology, clinical and neurologic status. Arquivos de Neuro-Psiquiatria. 2015;73(4):330-335. DOI: 10.1590/0004-282X20150003
  4. 4. Mundy GR. Metastasis to bone: Causes, consequences and therapeutic opportunities. Nature Reviews Cancer. 2002;2(8):584-593. DOI: 10.1038/nrc867
  5. 5. Hortobagyi GN, Theriault RL, Lipton A, Porter L, Blayney D, Sinoff C, et al. Long-term prevention of skeletal complications of metastatic breast cancer with pamidronate. Journal of Clinical Oncology. 1998;16(6):2038-2044. DOI: 10.1200/JCO.1998.16.6.2038
  6. 6. Chou R, Qaseem A, Owens DK, Shekelle P. Diagnostic imaging for low back pain: Advice for high-value health care from the American College of Physicians. Annals of Internal Medicine. 2011;154(3):181-189. DOI: 10.7326/0003-4819-154-3-201102010-00008
  7. 7. Doi K. Computer-aided diagnosis in medical imaging: Historical review, current status and future potential. Computerized Medical Imaging and Graphics. 2007;31(4-5):198-211. DOI: 10.1016/j.compmedimag.2007.02.002
  8. 8. Ruiz-España S, Arana E, Moratal D. Semiautomatic computer-aided classification of degenerative lumbar spine disease in magnetic resonance imaging. Computers in Biology and Medicine. 2015;62:196-205. DOI: 10.1016/j.compbiomed.2015.04.028
  9. 9. Alomari RS, Ghosh S, Koh J, Chaudhary V. Vertebral column localization, labeling, and segmentation. Spinal Imaging and Image Analysis. 2015;18:193-229. DOI: 10.1007/978-3-319-12508-4
  10. 10. Yao J, O’Connor SD, Summers RM. Automated spinal column extraction and partitioning. In: Proceedings of the IEEE International Symposium on Biomedical Imaging: From Nano to Macro (ISBI 2006); 2006. pp. 390-393. DOI: 10.1109/ISBI.2006.1624935
  11. 11. Kang Y, Engelke K, Kalender WA. A new accurate and precise 3-D segmentation method for skeletal structures in volumetric CT data. IEEE Transactions on Medical Imaging. 2003;22(5):586-598. DOI: 10.1109/TMI.2003.812265
  12. 12. Lim PH, Bagci U, Bai L. Introducing Willmore flow into level set segmentation of spinal vertebrae. IEEE Transactions on Bio-Medical Engineering. 2013;60(1):115-122. DOI: 10.1109/TBME.2012.2225833
  13. 13. Ruiz-España S, Díaz-Parra A, Arana E, Moratal D. A fully automated level-set based segmentation method of thoracic and lumbar vertebral bodies in computed tomography images. In: Proceedings of the IEEE Engineering in Medicine and Biology Society; EMBC 2015; 2015. pp. 3049-3052
  14. 14. Ma J, Lu L, Zhan Y, Zhou X, Salganicoff M, Krishnan A. Hierarchical segmentation and identification of thoracic vertebra using learning-based edge detection and coarse-to-fine deformable model. In: Proceedings of the Medical Image Computing and Computer-Assisted Intervention (MICCAI 2010); 2010. pp. 19-27. DOI: 10.1007/978-3-642-15705-9_3
  15. 15. Kim Y, Kim D. A fully automatic vertebra segmentation method using 3D deformable fences. Computerized Medical Imaging and Graphics. 2009;33(5):343-352. DOI: 10.1016/j.compmedimag.2009.02.006
  16. 16. Klinder T, Ostermann J, Ehm M, Franz A, Kneser R, Lorenz C. Automated model-based vertebra detection, identification, and segmentation in CT images. Medical Image Analysis. 2009;13(3):471-482. DOI: 10.1016/
  17. 17. Korez R, Ibragimov B, Likar B, Pernus F, Vrtovec T. A Framework for automated spine and vertebrae interpolation-based detection and model-based segmentation. IEEE Transactions on Medical Imaging. 2015;34(8):1649-1662. DOI: 10.1109/TMI.2015.2389334
  18. 18. Rasoulian A, Rohling R, Abolmaesumi P. Lumbar spine segmentation using a statistical multi-vertebrae anatomical shape+pose model. IEEE Transactions on Medical Imaging. 2013;32:1890-1900. DOI: 10.1109/TMI.2013.2268424
  19. 19. Castro-mateos I, Pozo JM, Pereañez M, Lekadir K, Lazary A, Frangi AF. Statistical interspace models (SIMs): Application to robust 3D spine segmentation. IEEE Transactions on Medical Imaging. 2015;34(8):1663-1675. DOI: 10.1109/TMI.2015.244391
  20. 20. Roberts MG, Cootes TF, Pacheco E, Oh T, Adams JE. Segmentation of lumbar vertebrae using part-based graphs and active appearance models. In: Proceedings of the Medical Image Computing and Computer-Assisted Intervention (MICCAI 209). 2009;12(Pt 2):1017-1024. DOI: 10.1007/978-3-642-04271-3_123
  21. 21. Forsberg D. Atlas-based registration for accurate segmentation of thoracic and lumbar vertebrae in CT data. Recent Advances in Computational Methods and Clinical Applications for Spine Imaging. 2015;20:49-59. DOI: 10.1007/978-3-319-14148-0_5
  22. 22. Hardisty M, Gordon L, Agarwal P, Skrinskas T, Whyne C. Quantitative characterization of metastatic disease in the spine. Part I. Semiautomated segmentation using atlas-based deformable registration and the level set method. Medical Physics. 2007;34(8):3127. DOI: 10.1118/1.2746498
  23. 23. Ruiz-España S, Domingo J, Díaz-Parra A, Dura E, D’Ocón-Alcañiz V, Arana E, et al. Automatic segmentation of the spine by means of a probabilistic atlas with a special focus on ribs supression. Preliminary results. In: Proceedings of the IEEE Engineering in Medicine and Biology Society (EMBC 2015); 2015; IEEE. pp. 2014-2017
  24. 24. Heiberg E, Sjögren J, Ugander M, Carlsson M, Engblom H, Arheden H. Design and validation of segment—Freely available software for cardiovascular image analysis. BMC Medical Imaging. 2010;10:1. DOI: 10.1186/1471-2342-10-1
  25. 25. Scientific Computing and Imaging Institute (SCI). Seg3D: Volumetric Image Segmentation and Visualization [Internet]. Available from: [Accessed: 12 November, 2016]
  26. 26. Casero R, Burton RA, Quinn T, Bollensdorff C, Hales P, Schneider JE, et al. Cardiac valve annulus manual segmentation using computer assisted visual feedback in three-dimensional image data. In: Proceedings of the IEEE Engineering in Medicine and Biology Society (EMBC 2010); 2010; IEEE. pp. 738-741. DOI: 10.1109/IEMBS.2010.5626303
  27. 27. Brayda-Bruno M, Tibiletti M, Ito K, Fairbank J, Galbusera F, Zerbi A, et al. Advances in the diagnosis of degenerated lumbar discs and their possible clinical application. European Spine Journal. 2014;23(3):S315–S323. DOI: 10.1007/s00586-013-2960-9
  28. 28. Larroza A, Bodí V, Moratal D. Texture analysis in magnetic resonance imaging: Review and considerations for future applications. In: Constantinides C, editor. Assessment of Cellular and Organ Function and Dysfunction Using Direct and Derived MRI Methodologies. Rijeka, Croatia: InTech; 2016. DOI: 10.5772/64641
  29. 29. Quattrocchi CC, Santini D, Delláia P, Piciucchi S, Leoncini E, Vincenzi B, et al. A prospective analysis of CT density measurements of bone metastases after treatment with zoledronic acid. Skeletal Radiology. 2007;36(12):1121-1127. DOI: 10.1007/s00256-007-0388-1

Written By

Silvia Ruiz-España and David Moratal

Submitted: November 29th, 2016 Reviewed: March 15th, 2017 Published: August 9th, 2017