sct_analyze_lesion

Compute statistics on segmented lesions. The function assigns an ID value to each lesion (1, 2, 3, etc.) and then outputs morphometric measures for each lesion:

  • volume [mm^3]: volume of the lesion

  • length [mm]: maximal length along the Superior-Inferior (SI) axis across all sagittal slices of the lesion

  • width [mm]: maximal width along the Anterior-Posterior (AP) axis across all sagittal slices of the lesion

  • max_equivalent_diameter [mm]: maximum diameter of the lesion, when approximating the lesion as a circle in the axial plane

  • max_axial_damage_ratio []: maximum ratio of the lesion area divided by the spinal cord area

  • interpolated_midsagittal_slice: number (float) corresponding to the interpolated midsagittal slice

  • length_interpolated_midsagittal_slice [mm]: length of the lesion along the Superior-Inferior (SI) axis in the interpolated midsagittal slice

  • width_interpolated_midsagittal_slice [mm]: width of the lesion along the Anterior-Posterior (AP) axis the interpolated midsagittal slice

  • interpolated_dorsal_bridge_width [mm]: width of spared tissue dorsal to the spinal cord lesion in the interpolated midsagittal slice

  • interpolated_ventral_bridge_width [mm]: width of spared tissue ventral to the spinal cord lesion in the interpolated midsagittal slice

  • dorsal_bridge_width [mm]: width of spared tissue dorsal to the spinal cord lesion (i.e. towards the posterior direction of the AP axis) for each sagittal slice containing the lesion

  • ventral_bridge_width [mm]: width of spared tissue ventral to the spinal cord lesion (i.e. towards the anterior direction of the AP axis) for each sagittal slice containing the lesion

If the proportion of lesion in each region (e.g. WM and GM) does not sum up to 100%, it means that the registered template does not fully cover the lesion. In that case you might want to check the registration results.

usage: sct_analyze_lesion -m <file> [-s <file>] [-i <file>] [-f <str>]
                          [-perslice <int>] [-ofolder <folder>] [-qc <folder>]
                          [-qc-dataset <str>] [-qc-subject <str>] [-h]
                          [-v <int>] [-profile-time [<file>]]
                          [-trace-memory [<folder>]] [-r {0,1}]

MANDATORY ARGUMENTS

-m

Binary mask of lesions (lesions are labeled as “1”).

OPTIONAL ARGUMENTS

-s

Spinal cord centerline or segmentation file, which will be used to correct morphometric measures with cord angle with respect to slice. (e.g. t2_seg.nii.gz)

If provided, then the lesion volume, length, diameter, axial damage ratio, and tissue bridges will be computed. Otherwise, if not provided, then only the lesion volume will be computed.

-i

Image from which to extract average values within lesions (e.g. “t2.nii.gz”). If provided, the function computes the mean and standard deviation values of this image within each lesion.

-f

Path to folder containing the atlas/template registered to the anatomical image. If provided, the function computes:

  1. for each lesion, the proportion of that lesion within each vertebral level and each region of the template (e.g. GM, WM, WM tracts). Each cell contains a percentage value representing how much of the lesion volume exists within the region indicated by the row/column (rows represent vertebral levels, columns represent ROIs). The percentage values are summed to totals in both the bottom row and the right column, and the sum of all cells is 100 (i.e. 100 percent of the lesion), found in the bottom-right.

  2. the proportions of each ROI (e.g. vertebral level, GM, WM) occupied by lesions.

These percentage values are stored in different pages of the output lesion_analysis.xlsx spreadsheet; one page for each lesion (a.) plus a final page summarizing the total ROI occupation of all lesions (b.)

-perslice

Possible choices: 0, 1

Specify whether to aggregate atlas metrics (-f option) per slice (-perslice 1) or per vertebral level (default behavior).

Default: 0

-ofolder

Output folder (e.g. “.”). Default is the current folder (”.”).

Default: “.”

-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.

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.

-r

Possible choices: 0, 1

Remove temporary files.

Default: 1