sct_analyze_texture

Extraction of gray level co-occurence matrix (GLCM) texture features from an image within a given mask. The textures features are those defined in the sckit-image implementation: https://scikit-image.org/docs/dev/api/skimage.feature.html#graycoprops. This function outputs one nifti file per texture metric (contrast,dissimilarity,homogeneity,energy,correlation,ASM) and per orientation called fnameInput_feature_distance_angle.nii.gz. Also, a file averaging each metric across the angles, called fnameInput_feature_distance_mean.nii.gz, is output.

usage: sct_analyze_texture -i <file> -m <file> [-feature <str>]
                           [-distance <int>] [-angle <list>] [-dim {ax,sag,cor}]
                           [-ofolder <folder>] [-h] [-v <int>]
                           [-profile-time [<file>]] [-trace-memory [<folder>]]
                           [-r {0,1}]

MANDATORY ARGUMENTS

-i

Image to analyze. Example: t2.nii.gz

-m

Image mask. Example: t2_seg.nii.gz

OPTIONAL ARGUMENTS

-feature

List of GLCM texture features (separate arguments with ,).

Default: “contrast,dissimilarity,homogeneity,energy,correlation,ASM”

-distance

Distance offset for GLCM computation, in pixel (suggested distance values between 1 and 5).

Default: 1

-angle

List of angles for GLCM computation, separate arguments with ,, in degrees (suggested distance values between 0 and 179).

Default: “0,45,90,135”

-dim

Possible choices: ax, sag, cor

Compute the texture on the axial (ax), sagittal (sag) or coronal (cor) slices.

Default: “ax”

-ofolder

Output folder.

Default: “./texture”

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.

-r

Possible choices: 0, 1

Remove temporary files.

Default: 1