sct_qc

Generate Quality Control (QC) report following SCT processing.

usage: sct_qc -i IMAGE -p
              {sct_propseg,sct_deepseg_sc,sct_deepseg_gm,sct_deepseg_lesion,sct_register_multimodal,sct_register_to_template,sct_warp_template,sct_label_vertebrae,sct_detect_pmj,sct_label_utils,sct_get_centerline,sct_fmri_moco,sct_dmri_moco,sct_image_stitch,sct_fmri_compute_tsnr}
              [-s SEG] [-d DEST] [-plane {axial,sagittal}] [-resample RESAMPLE]
              [-text-labels {0,1}] [-qc QC] [-qc-dataset DATASET]
              [-qc-subject SUBJECT] [-fps float] [-h] [-v <int>]
              [-profile-time [<file>]] [-trace-memory [<folder>]]

MANDATORY ARGUMENTS

-i

Input image #1

-p

Possible choices: sct_propseg, sct_deepseg_sc, sct_deepseg_gm, sct_deepseg_lesion, sct_register_multimodal, sct_register_to_template, sct_warp_template, sct_label_vertebrae, sct_detect_pmj, sct_label_utils, sct_get_centerline, sct_fmri_moco, sct_dmri_moco, sct_image_stitch, sct_fmri_compute_tsnr

SCT function associated with the QC report to generate

OPTIONAL ARGUMENTS

-s

Input segmentation or label

-d

Input image #2 to overlay on image #1 (requires a segmentation), or output of another process. Example: sct_straighten_spinalcord

-plane

Possible choices: axial, sagittal

Plane of the output QC. Only relevant for -p sct_deepseg_lesion.

-resample

Millimeter resolution to resample the image to. Set to 0 to turn off resampling. You can use this option to control the zoom of the QC report: higher values will result in smaller images, and lower values will result in larger images.

-text-labels

Possible choices: 0, 1

If set to 0, text won’t be drawn on top of labels. Only relevant for -p sct_label_vertebrae.

Default: 1

-qc

Path to save QC report.

Default: “./qc”

-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

-fps

The number of frames per second for output gif images. Only useful for sct_fmri_moco and sct_dmri_moco.

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

Examples:

  • sct_qc -i t2.nii.gz -s t2_seg.nii.gz -p sct_deepseg_sc

  • sct_qc -i t2.nii.gz -s t2_pmj.nii.gz -p sct_detect_pmj

  • sct_qc -i t2.nii.gz -s t2_seg_labeled.nii.gz -p sct_label_vertebrae

  • sct_qc -i t2.nii.gz -s t2_seg.nii.gz -p sct_deepseg_sc -qc-dataset mydata -qc-subject sub-45

  • sct_qc -i t2.nii.gz -s t2_seg.nii.gz -d t2_lesion.nii.gz -p sct_deepseg_lesion -plane axial