sct_compute_compression

Compute normalized morphometric metrics to assess:

  • spinal cord compression using MSCC (maximum spinal cord compression)

  • spinal canal stenosis using MCC (maximum canal compromise)

Metrics are normalized using the non-compressed levels above and below the compression site using the following equation:

ratio = (1 - mi/((ma+mb)/2))

Where mi: metric at the compression level, ma: metric above the compression level, mb: metric below the compression level.

Additionally, if the -normalize-hc flag is used, metrics are normalized using a database built from healthy control subjects. This database uses the PAM50 template as an anatomical reference system.

References:

  • Sandrine Bédard, Jan Valošek, Maryam Seif, Armin Curt, Simon Schading, Nikolai Pfender, Patrick Freund, Markus Hupp, Julien Cohen-Adad. Normalizing Spinal Cord Compression Morphometric Measures: Application in Degenerative Cervical Myelopathy. medRxiv 2024.03.13.24304177 https://doi.org/10.1101/2024.03.13.24304177

  • Miyanji F, Furlan JC, Aarabi B, Arnold PM, Fehlings MG. Acute cervical traumatic spinal cord injury: MR imaging findings correlated with neurologic outcome–prospective study with 100 consecutive patients. Radiology 2007;243[3]:820-827. https://doi.org/10.1148/radiol.2433060583

  • -normalize-hc flag: Valošek J, Bédard S, Keřkovský M, Rohan T, Cohen-Adad J. A database of the healthy human spinal cord morphometry in the PAM50 template space. Imaging Neuroscience 2024; 2 1–15. https://doi.org/10.1162/imag_a_00075

usage: sct_compute_compression -i <file> -vertfile <file> -l <file>
                               [-extent <float>] [-distance <float>] [-o <file>]
                               [-normalize-hc <int>]
                               [-metric {diameter_AP,area,diameter_RL,eccentricity,solidity}]
                               [-sex {F,M}] [-age [0 100] [0 100]] [-h]
                               [-v <int>] [-profile-time [<file>]]
                               [-trace-memory [<folder>]]

MANDATORY ARGUMENTS

-i

Spinal cord or spinal canal segmentation mask to compute morphometrics from. If spinal cord segmentation is provided, MSCC is computed. If spinal canal segmentation (spinal cord + CSF) is provided, MCC is computed. Example: sub-001_T2w_seg.nii.gz

Note: If no normalization is wanted (i.e., if the -normalize-hc flag is not specified), metric ratio will take the average along the segmentation centerline.

-vertfile

Vertebral labeling file. Example: sub-001_T2w_seg_labeled.nii.gz

Note: The input and the vertebral labelling file must be in the same voxel coordinate system and must match the dimensions between each other.

-l

NIfTI file that includes labels at the compression sites. Each compression site is denoted by a single voxel of value 1. Example: sub-001_T2w_compression_labels.nii.gz

Note: The input and the compression label file must be in the same voxel coordinate system and must match the dimensions between each other.

OPTIONAL ARGUMENTS

-extent

Extent (in mm) to average metrics of healthy levels in superior-inferior direction.

Default: 20.0

-distance

Distance (in mm) in the superior-inferior direction from the compression to average healthy slices.

Default: 10.0

-o

Output CSV file name. If not provided, the suffix _compression_metrics is added to the file name provided by the flag -i.

NORMALIZATION ARGUMENTS

-normalize-hc

Possible choices: 0, 1

Set to 1 to normalize the metrics using a database of healthy controls. Default: 0.

Note: This flag should not be set to 1 when computing the MCC (i.e. using spinal canal segmentation), and should only be used when computing the MSCC (i.e. using spinal cord segmentation).

-metric

Possible choices: diameter_AP, area, diameter_RL, eccentricity, solidity

Metric to normalize.

Default: “diameter_AP”

-sex

Possible choices: F, M

Sex of healthy subject to use for the normalization. By default, both sexes are used.

-age

Age range of healthy subjects to use for the normalization. Example: -age 60 80. By default, all ages are considered.

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/7.0/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 as snakeviz).

-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 additional snapshot_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/7.0/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.