Skip to main content

Thank you for visiting You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Fully automatic 3D segmentation of the thoracolumbar spinal cord and the vertebral canal from T2-weighted MRI using K-means clustering algorithm


Study design

Method development.


To develop a reliable protocol for automatic segmentation of Thoracolumbar spinal cord using MRI based on K-means clustering algorithm in 3D images.


University-based laboratory, Tehran, Iran.


T2 structural volumes acquired from the spinal cord of 20 uninjured volunteers on a 3T MR scanner. We proposed an automatic method for spinal cord segmentation based on the K-means clustering algorithm in 3D images and compare our results with two available segmentation methods (PropSeg, DeepSeg) implemented in the Spinal Cord Toolbox. Dice and Hausdorff were used to compare the results of our method (K-Seg) with the manual segmentation, PropSeg, and DeepSeg.


The accuracy of our automatic segmentation method for T2-weighted images was significantly better or similar to the SCT methods, in terms of 3D DC (p < 0.001). The 3D DCs were respectively (0.81 ± 0.04) and Hausdorff Distance (12.3 ± 2.48) by the K-Seg method in contrary to other SCT methods for T2-weighted images.


The output with similar protocols showed that K-Seg results match the manual segmentation better than the other methods especially on the thoracolumbar levels in the spinal cord due to the low image contrast as a result of poor SNR in these areas.

Access options

Rent or Buy article

Get time limited or full article access on ReadCube.


All prices are NET prices.

Fig. 1: The framework of the K-Seg method.
Fig. 2: Examples of spinal cord segmentation on Sagittal and Axial images.
Fig. 3: Cross-sectional areas (CSA) along the spinal cord for twenty subjects.


  1. 1.

    Seif M, Gandini Wheeler-Kingshott CA, Cohen-Adad J, Flanders AE, Freund P. Guidelines for the conduct of clinical trials in spinal cord injury: neuroimaging biomarkers. Spinal Cord. 2019;57:717–28.

  2. 2.

    Freund P, Seif M, Weiskopf N, Friston K, Fehlings MG, Thompson AJ, et al. MRI in traumatic spinal cord injury: from clinical assessment to neuroimaging biomarkers. Lancet Neurol. 2019;18:1123–35.

  3. 3.

    Ahuja CS, Wilson JR, Nori S, Kotter MRN, Druschel C, Curt A, et al. Traumatic spinal cord injury. Nat Rev Dis Prim. 2017;3:1–21.

  4. 4.

    Talekar K, Poplawski M, Hegde R, Cox M, Flanders A. Imaging of spinal cord injury: acute cervical spinal cord injury, cervical spondylotic myelopathy, and cord herniation. Semin Ultrasound, CT MRI. 2016;37:431–47.

    Article  Google Scholar 

  5. 5.

    Bozzo A, Marcoux J, Radhakrishna M, Pelletier J, Goulet B. The role of magnetic resonance imaging in the management of acute spinal cord injury. J Neurotrauma. 2011;28:1401–11.

    Article  Google Scholar 

  6. 6.

    Fehlings MG, Martin AR, Tetreault LA, Aarabi B, Anderson P, Arnold PM, et al. A clinical practice guideline for the management of patients with acute spinal cord injury: recommendations on the role of baseline magnetic resonance imaging in clinical decision making and outcome prediction. Glob Spine J. 2017;7:221S–30S.

    Article  Google Scholar 

  7. 7.

    Lévy S, Guertin M, Khatibi A, Mezer A, Martinu K, Chen J, et al. Test-retest reliability of myelin imaging in the human spinal cord: Measurement errors versus region- and aging-induced variations. PLOS ONE. 2018;13:e0199796. 1–25

  8. 8.

    De Leener B, Kadoury S, Cohen-Adad J. Robust, accurate and fast automatic segmentation of the spinal cord. Neuroimage. 2014;98:528–36.

    Article  PubMed  Google Scholar 

  9. 9.

    Schlaeger R, Papinutto N, Panara V, Bevan C, Lobach IV, Bucci M, et al. Spinal cord gray matter atrophy correlates with multiple sclerosis disability. Ann Neurol. 2014;76:568–80.

    Article  PubMed  PubMed Central  Google Scholar 

  10. 10.

    Lin X. Spinal cord atrophy and disability in multiple sclerosis over four years: application of a reproducible automated technique in monitoring disease progression in a cohort of the interferon -1a (Rebif) treatment trial. J Neurol Neurosurg Psychiatry. 2003;74:1090–4.

  11. 11.

    Gros C, De Leener B, Badji A, Maranzano J, Eden D, Dupont SM, et al. Automatic segmentation of the spinal cord and intramedullary multiple sclerosis lesions with convolutional neural networks. 2018.

  12. 12.

    Tench CR, Morgan PS, Constantinescu CS. Measurement of cervical spinal cord cross-sectional area by MRI using edge detection and partial volume correction. J Magn Reson Imaging. 2005;21:197–203.

  13. 13.

    Horsfield MA, Sala S, Neema M, Absinta M, Bakshi A, Sormani MP, et al. Rapid semi-automatic segmentation of the spinal cord from magnetic resonance images: Application in multiple sclerosis. Neuroimage. 2010;50:446–55.

    Article  Google Scholar 

  14. 14.

    Coulon O, Hickman SJ, Parker GJ, Barker GJ, Miller DH, Arridge SR. Quantification of spinal cord atrophy from magnetic resonance images via a B-spline active surface model. Magn Reson Med. 2002;47:1176–85.

    CAS  Article  Google Scholar 

  15. 15.

    El Mendili M-M, Chen R, Tiret B, Villard N, Trunet S, Pélégrini-Issac M, et al. Fast and accurate semi-automated segmentation method of spinal cord MR images at 3T applied to the construction of a cervical spinal cord template. PLoS ONE. 2015.

  16. 16.

    Kawahara J, McIntosh C, Tam R, Hamarneh G. Globally optimal spinal cord segmentation using a minimal path in high dimensions. IEEE 10th International Symposium on Biomedical Imaging: From Nano to Macro, ISBI. IEEE Computer Society, 2013; pp. 848–851.

  17. 17.

    Cadotte A, Cadotte DW, Livne M,  Cohen-Adad J, Fleet D, Mikulis D, et al. Spinal cord segmentation by one dimensional normalized template matching: a novel, quantitative technique to analyze advanced magnetic resonance imaging data. PLoS ONE. 2015;10:e0139323.

  18. 18.

    De Leener B, Cohen-Adad J, Kadoury S. Automatic segmentation of the spinal cord and spinal canal coupled with vertebral labeling. IEEE Trans Med Imaging. 2015;34:1705–18.

    Article  Google Scholar 

  19. 19.

    De Leener B, Taso M, Cohen-Adad J, Callot V. Segmentation of the human spinal cord. Magn Reson Mater Physics. Biol Med. 2016;29:125–53.

    Google Scholar 

  20. 20.

    Neubert A, Fripp J, Shen K, Salvado O, Schwarz R, Lauer L, et al. Automated 3D segmentation of vertebral bodies and intervertebral discs from MRI. In Proceedings of IEEE DICTA. 2011; pp. 19–24.

  21. 21.

    Koh J, Scott PD, Chaudhary V, Dhillon G. An automatic segmentation method of the spinal canal from clinical MR images based on an attention model and an active contour model. In: 2011 IEEE International Symposium on Biomedical Imaging: From Nano to Macro. IEEE; 2011. p. 1467–71.

  22. 22.

    Koh J, Kim T, Chaudhary V, Dhillon G. Automatic segmentation of the spinal cord and the dural sac in lumbar MR images using gradient vector flow field. Conf Proc IEEE Eng Med Biol Soc. 2010;3117–20.

  23. 23.

    Unser M, Thevenaz P. Optimization of mutual information for multiresolution image registration. IEEE Trans Image Process. 2000;9:2083–99.

  24. 24.

    Canny J A. Computational approach to edge detection. IEEE Trans Pattern Anal Mach Intell. 1986;PAMI-8:679–98.

  25. 25.

    Ballard DH. Generalizing the Hough transform to detect arbitrary shapes. Pattern Recognit. 1981;13:111–22.

    Article  Google Scholar 

  26. 26.

    Perasso A, Campi C, Massone AM, Beltrametti MC. Spinal Canal and Spinal Marrow Segmentation by Means of the Hough Transform of Special Classes of Curves. In: Murino V., Puppo E. (eds) Image Analysis and Processing. ICIAP 2015. Lecture Notes in Computer Science, vol 9279. Springer, Cham.

  27. 27.

    Black MJ, Sapiro G, Marimont DH, Heeger D. Robust {A}nisotropic {D}iffusion. IEEE Trans Image Process. 1998;7:421–32.

    CAS  Article  Google Scholar 

  28. 28.

    Perona P, Malik J. Scale-space and edge detection using anisotropic diffusion. IEEE Trans Pattern Anal Mach Intell. 1990;12:629–39.

    Article  Google Scholar 

  29. 29.

    Patel PM, Shah BN, Shah V. Image segmentation using K-mean clustering for finding tumor in medical application. Int J Comput Trends Technol. 2013;4:1239–42.

    Google Scholar 

  30. 30.

    Dhanachandra N, Manglem K, Chanu YJ. Image segmentation using K-means clustering algorithm and subtractive clustering algorithm. Procedia Comput Sci. 2015;54:764–71.

    Article  Google Scholar 

  31. 31.

    Dice LR. Measures of the amount of ecologic association between species. Ecology. 1945;26:297–302.

    Article  Google Scholar 

  32. 32.

    Aspert N, Santa-Cruz D, Ebrahimi T. MESH: Measuring Errors between Surfaces using the Hausdorff Distance. In IEEE Multimedia. 2002;705–8.

  33. 33.

    Kim H-Y Analysis of variance (ANOVA) comparing means of more than two groups. Restor Dent Endod. 2014;39:74–7.

Download references

Author information




SS, SAB, and MAO were involved in study design, method development, and manuscript preparation. HD and AK were involved in study design, method development, data acquisition, and manuscript preparation.

Corresponding author

Correspondence to Mohammad Ali Oghabian.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Ethical statement

We certify that all applicable institutional and governmental regulations concerning the ethical use of human volunteers were followed during the course of this research.

Informed consent

All the data were anonymized before the processing and participants gave written consent for sharing their data.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Sabaghian, S., Dehghani, H., Batouli, S.A.H. et al. Fully automatic 3D segmentation of the thoracolumbar spinal cord and the vertebral canal from T2-weighted MRI using K-means clustering algorithm. Spinal Cord 58, 811–820 (2020).

Download citation

Further reading


Quick links