sct_detect_compression¶
Predict compression probability in a spinal cord MRI image using spinal cord shape metrics. The script process axial slices at the level of intervertebral discs C3/C4 (value: 4) to C6/C7 (value: 7).
Compression categories are determined based on the following cut-offs:
‘yes’ : p > 0.451
‘possible’: 0.345 <= p <= 0.451
‘no’ : p < 0.345
These cut-off values and compression categories were determined by ROC analysis and the Youden’s index (the sum of sensitivity and specificity). More info in the reference below.
Reference:
Horáková M, Horák T, Valošek J, Rohan T, Koriťáková E, Dostál M, Kočica J, Skutil T, Keřkovský M, Kadaňka Z Jr, Bednařík P, Svátková A, Hluštík P, Bednařík J. Semi-automated detection of cervical spinal cord compression with the Spinal Cord Toolbox. Quant Imaging Med Surg 2022; 12:2261–2279. https://doi.org/10.21037/qims-21-782
usage: sct_detect_compression -s <file> -discfile <file> [-num-of-slices <int>]
[-angle-corr <int>] [-o <file>] [-h] [-v <int>]
[-profile-time [<file>]]
[-trace-memory [<folder>]]
MANDATORY ARGUMENTS¶
- -s
Segmentation of the spinal cord, which will be used to compute the shape metrics. Example:
t2s_seg.nii.gz
.- -discfile
File with disc labels. Each label must be a single voxel. Only label values 4, 5, 6, and 7 (C3/C4 to C6/C7) are supported for now; all other labels will be ignored. Labels can be located either at the posterior edge of the intervertebral discs, or at the orthogonal projection of each disc onto the spinal cord. Such a label file can be manually created using:
sct_label_utils -i IMAGE_REF -create-viewer 4:7
or obtained automatically using thesct_label_vertebrae
function (the file with thelabeled_discs.nii.gz
suffix). Example:t2s_discs.nii.gz
.
OPTIONAL ARGUMENTS¶
- -num-of-slices
Number of additional axial slices above and below the intervertebral disc to process. Specifying
-num-of-slices 1
will process 3 slices total per disc (+/- 1),2
will process 5 slices total (+/- 2), and so on.Default: 0
- -angle-corr
Possible choices: 0, 1
Angle correction for computing morphometric measures. When angle correction is used, the cord within the slice is stretched/expanded by a factor corresponding to the cosine of the angle between the centerline and the axial plane. If the cord is already quasi-orthogonal to the slab, you can set
-angle-corr
to 0.Default: 1
- -o
Output CSV file name. If not provided, the suffix
compression_results
is added to the file name provided by the flag-s
.
MISC ARGUMENTS¶
- -v
Possible choices: 0, 1, 2
Verbosity. 0: Display only errors/warnings, 1: Errors/warnings + info messages, 2: Debug mode.
Default: 1
- -profile-time
Enables time-based profiling of the program, dumping the results to the specified file.
If no file is specified, human-readable results are placed into a ‘time_profiling_results.txt’ document in the current directory (’/home/docs/checkouts/readthedocs.org/user_builds/spinalcordtoolbox/checkouts/stable/documentation/source’). If the specified file is a
.prof
file, the file will instead be in binary format, ready for use with common post-profiler utilities (such assnakeviz
).- -trace-memory
Enables memory tracing of the program.
When active, a measure of the peak memory (in KiB) will be output to the file
peak_memory.txt
. Optionally, developers can also modify the SCT code to add additionalsnapshot_memory()
calls. These calls will ‘snapshot’ the memory usage at that moment, saving the memory trace at that point into a second file (memory_snapshots.txt
).By default, both outputs will be placed in the current directory (’/home/docs/checkouts/readthedocs.org/user_builds/spinalcordtoolbox/checkouts/stable/documentation/source’). Optionally, you may provide an alternative directory (
-trace-memory <dir_name>
), in which case all files will be placed in that directory instead. Note that this WILL incur an overhead to runtime, so it is generally advised that you do not run this in conjunction with the time profiler or in time-sensitive contexts.