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

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 seg- ment 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 recon- structions, 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.


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 [10][11][12][13]. 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 [14][15][16][17]. 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 [21][22][23]. 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-byslice 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.

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.
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.

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.

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. 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.
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.

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.
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.

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.

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.