sct_label_vertebrae

This function takes an anatomical image and its cord segmentation (binary file), and outputs the cord segmentation labeled with vertebral level. The algorithm requires an initialization (first disc) and then performs a disc search in the superior, then inferior direction, using template disc matching based on mutual information score. The automatic method uses the module implemented in ‘spinalcordtoolbox/vertebrae/detect_c2c3.py’ to detect the C2-C3 disc.

usage: sct_label_vertebrae -i <file> -s <file> -c {t1,t2} [-h] [-t <folder>]
                           [-initz <list>] [-initcenter <int>]
                           [-initfile <file>] [-initlabel <file>]
                           [-discfile <file>] [-ofolder <file>]
                           [-laplacian <int>] [-clean-labels <int>]
                           [-scale-dist <float>] [-param <list>] [-r <int>]
                           [-v <int>] [-qc <folder>] [-qc-dataset <str>]
                           [-qc-subject <str>]

MANDATORY ARGUMENTS

-i

Input image. Example: t2.nii.gz

-s

Segmentation of the spinal cord. Example: t2_seg.nii.gz

-c

Possible choices: t1, t2

Type of image contrast. ‘t2’: cord dark / CSF bright. ‘t1’: cord bright / CSF dark

OPTIONAL ARGUMENTS

-t

Path to template.

Default: “/home/docs/checkouts/readthedocs.org/user_builds/spinalcordtoolbox/checkouts/stable/data/PAM50”

-initz

Initialize using slice number and disc value. Example: 68,4 (slice 68 corresponds to disc C3/C4).

WARNING: Slice number should correspond to superior-inferior direction (i.e. Z in RPI orientation, but Y in LIP orientation).

-initcenter

Initialize using disc value centered in the rostro-caudal direction. If the spine is curved, then consider the disc that projects onto the cord at the center of the z-FOV.

-initfile

Initialize labeling by providing a text file which includes either -initz or -initcenter flag.

-initlabel

Initialize vertebral labeling by providing a nifti file that has a single disc label. An example of such file is a single voxel with value ‘3’, which would be located at the posterior tip of C2-C3 disc. Such label file can be created using: sct_label_utils -i IMAGE_REF -create-viewer 3; or by using the Python module ‘detect_c2c3’ implemented in ‘spinalcordtoolbox/vertebrae/detect_c2c3.py’.

-discfile

File with disc labels, which will be used to transform the input segmentation into a vertebral level file. In that case, there will be no disc detection. The convention for disc labels is the following: value=3 -> disc C2/C3, value=4 -> disc C3/C4, etc.

-ofolder

Output folder.

Default: “”

-laplacian

Possible choices: 0, 1

Apply Laplacian filtering. More accurate but could mistake disc depending on anatomy.

Default: 0

-clean-labels

Possible choices: 0, 1, 2

Clean output labeled segmentation to resemble original segmentation. 0: no cleaning, 1: remove labeled voxels that fall outside the original segmentation, 2: -clean-labels 1, plus also fill in voxels so that the labels cover the entire original segmentation.

Default: 1

-scale-dist

Scaling factor to adjust the average distance between two adjacent intervertebral discs. For example, if you are dealing with images from pediatric population, the distance should be reduced, so you can try a scaling factor of about 0.7.

Default: 1.0

-param

Advanced parameters. Assign value with =; Separate arguments with ,

  • shift_AP [mm]: AP shift of centerline for disc search

  • size_AP [mm]: AP window size for disc search

  • size_RL [mm]: RL window size for disc search

  • size_IS [mm]: IS window size for disc search

Default: shift_AP=32,size_AP=11,size_RL=1,size_IS=19,shift_AP_visu=15

-r

Possible choices: 0, 1

Remove temporary files.

Default: 1

-v

Possible choices: 0, 1, 2

Verbosity. 0: Display only errors/warnings, 1: Errors/warnings + info messages, 2: Debug mode

Default: 1

-qc

The path where the quality control generated content will be saved.

-qc-dataset

If provided, this string will be mentioned in the QC report as the dataset the process was run on.

-qc-subject

If provided, this string will be mentioned in the QC report as the subject the process was run on.