sct_merge_images

Merge multiple source images (-i) onto destination space (-d). (All images are warped to the destination space and then added together.)

To deal with overlap during merging (e.g. multiple input images map to the same voxel regions in the destination space), the output voxels are divided by the sum of the partial volume values for each image.

Specifically, the per-voxel calculation used is: im_out = (im_1*pv_1 + im_2*pv_2 + ...) / (pv_1 + pv_2 + ...)

So this function acts like a weighted average operator, only in destination voxels that share multiple source voxels.

usage: sct_merge_images -i <file> [<file> ...] -d <file> -w <file> [<file> ...]
                        [-h] [-x <str>] [-o <file>] [-r {0,1}] [-v <int>]

MANDATORY ARGUMENTS

-i

Input images

-d

Destination image

-w

List of warping fields from input images to destination image

OPTIONAL ARGUMENTS

-x

Interpolation for warping the input images to the destination image. Default is linear

Default: “linear”

-o

Output image

Default: “merged_images.nii.gz”

-v

Possible choices: 0, 1, 2

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

Default: 1

MISC

-r

Possible choices: 0, 1

Remove temporary files.

Default: 1