Skip to content

Improve spine segmentation using totalspineseg ? #36

@tletut0ur

Description

@tletut0ur

First of all, thank you for the excellent resource that is the PAM50 template, it's been incredibly helpful in my work. While working with the template, I noticed that the vertebrae appear under-segmented, and in some cases, segmentation errors are visible, for instance, on axial slice 431.

Image
Image

Introduction of new methods such as totalspineseg offer a simple and quasi automatic way to mitigate this issue. I have run that model on the PAM50_t2.nii.gz file and binarized that segmentation using the following code

import nibabel as nib
import os
import numpy as np 

# output generated by sct_deepseg -i PAM50_t2.nii.gz -task totalspineseg
img_path = os.path.join(os.getenv("SCT_DIR"),"data\\PAM50\\template","PAM50_t2_step2_output.nii.gz")
img_outpath = os.path.join(os.getenv("SCT_DIR"),"data\\PAM50\\template","PAM50_spine_totalspineseg.nii.gz")

img = nib.load(img_path)
img_array = img.get_fdata()
img_bin_array = np.zeros_like(img_array)
img_bin_array[(img_array >=11) & (img_array < 50)] = 1
img_out = nib.Nifti1Image(img_bin_array, affine = img.affine)
nib.save(img_out, img_outpath)

PAM50_spine_totalspineseg.nii.gz
It doesn't solve everything, and spinous processes are still under-segmented in thoracic vertebrae. There might also be some collisions with CSF space to check. Other methods such as spineps could also be used.
I understand that the main focus of PAM50 is the spinal cord, but improving the vertebral segmentation would increase its usefulness for a broader range of applications. I'd be happy to help integrate or test improvements if needed.
Best regards,
Tom Le Tutour

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions