sct_apply_transfo

Apply transformations. This function is a wrapper for antsApplyTransforms (ANTs).

usage: sct_apply_transfo -i <file> -d <file> -w <file> [<file> ...]
                         [-winv <file> [<file> ...]] [-h] [-crop {0,1,2}]
                         [-o <file>] [-x {nn,linear,spline,label}] [-r {0,1}]
                         [-v <int>]

MANDATORY ARGUMENTS

-i

Input image. Example: t2.nii.gz

-d

Destination image. Example: out.nii.gz

-w

Transformation(s), which can be warping fields (nifti image) or affine transformation matrix (text file). Separate with space. Example: warp1.nii.gz warp2.nii.gz

OPTIONAL ARGUMENTS

-winv

Affine transformation(s) listed in flag -w which should be inverted before being used. Note that this only concerns affine transformation (not warping fields). If you would like to use an inverse warping field, then directly input the inverse warping field in flag -w.

Default: []

-crop

Possible choices: 0, 1, 2

Crop Reference. 0: no reference, 1: sets background to 0, 2: use normal background.

Default: 0

-o

Registered source. Example: dest.nii.gz

-x

Possible choices: nn, linear, spline, label

Interpolation method.

Note: The label method is a special interpolation method designed for single-voxel labels (e.g. disc labels used as registration landmarks, compression labels, etc.). This method is necessary because classical interpolation may corrupt the values of single-voxel labels, or cause them to disappear entirely. The function works by dilating each label, applying the transformation using nearest neighbour interpolation, then extracting the center-of-mass of each transformed ‘blob’ to get a single-voxel output label. Because the output is a single-voxel label, the -x label method is not appropriate for multi-voxel labeled segmentations (such as spinal cord or lesion masks).

Default: “spline”

-r

Possible choices: 0, 1

Remove temporary files.

Default: 1

-v

Possible choices: 0, 1, 2

Verbosity. 0: Display only errors/warnings, 1: Errors/warnings + info messages, 2: Debug mode

Default: 1