sct_compute_snr

Compute SNR using methods described in [Dietrich et al., Measurement of signal-to-noise ratios in MR images: Influence of multichannel coils, parallel imaging, and reconstruction filters. J Magn Reson Imaging 2007; 26(2): 375-385].

usage: sct_compute_snr -i <file> [-h] [-m <file>] [-m-noise <file>]
                       [-method {diff,mult,single}] [-vol <str>]
                       [-rayleigh {0,1}] [-r {0,1}] [-v <int>] [-o <str>]

MANDATORY ARGUMENTS

-i

Image to compute the SNR on. (Example: b0s.nii.gz)

  • For -method diff and -method mult, the image must be 4D, as SNR will be computed along the 4th dimension.

  • For -method single, the image can either be 3D or 4D. If a 4D image is passed, a specific 3D volume should be specified using the -vol argument.

OPTIONAL ARGUMENTS

-m

Binary (or weighted) mask within which SNR will be averaged. Example: dwi_moco_mean_seg.nii.gz

Default: “”

-m-noise

Binary (or weighted) mask within which noise will be calculated. Only valid for -method single.

Default: “”

-method

Possible choices: diff, mult, single

Method to use to compute the SNR (default: diff):

  • diff: Substract two volumes (defined by -vol) and estimate noise variance within the ROI (flag -m is required). Requires a 4D volume.

  • mult: Estimate noise variance over time across volumes specified with -vol. Requires a 4D volume.

  • single: Compute the mean signal in the mask specified by -m and estimate the noise variance in a mask specified by -m-noise. If the noise mask is in the background (air), the noise variance needs to be corrected for Rayleigh distribution (set -rayleigh 1). If the noise mask is located in a region with high signal (eg: tissue), noise distribution can be assumed Gaussian and there is no need to correct for Rayleigh distribution (use -rayleigh 0). This implementation corresponds to the SNRstdv in the Dietrich et al. article. Uses a 3D or a 4D volume. If a 4D volume is input, the volume to compute SNR on is specified by -vol.

Default: “diff”

-vol

Volumes to compute SNR from. Separate with , (Example: -vol 0,1), or select range using : (Example: -vol 2:50).

If this argument is not passed:

  • For -method mult, all volumes will be used.

  • For -method diff, the first two volumes will be used.

  • For -method single, the first volume will be used.

Default: “”

-rayleigh

Possible choices: 0, 1

Correct for Rayleigh distribution. It is recommended to always use this correction for the ‘diff’ method and to use it with the ‘single’ method in case the noise mask is taken in a region with low SNR (e.g., the air).

Default: 1

-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

-o

File name to write the computed SNR to.