sct_dmri_denoise_patch2self¶
Utility function to denoise diffusion MRI images. Returns the denoised image and also the difference between the input and the output. The Patch2Self denoising algorithm is based on self-supervised denoising via statistical independence of noise, as described in the following publications:
Fadnavis et al. Patch2Self: Denoising Diffusion MRI with Self-supervised Learning. NeurIPS, 2020, Vol. 33. (https://arxiv.org/abs/2011.01355)
Schilling et al. Patch2Self denoising of diffusion MRI in the cervical spinal cord improves intra-cord contrast, signal modelling, repeatability, and feature conspicuity. medRxiv, 2021. (https://www.medrxiv.org/content/10.1101/2021.10.04.21264389v2)
The implementation is based on DIPY (https://docs.dipy.org/stable/examples_built/preprocessing/denoise_patch2self.html).
usage: sct_dmri_denoise_patch2self -i <file> -b <file>
[-model {ols,ridge,lasso}] [-radius <int>]
[-o <str>] [-h] [-v <int>]
[-profile-time [<file>]]
[-trace-memory [<folder>]]
MANDATORY ARGUMENTS¶
- -i
Input NIfTI image to be denoised. Example:
image_input.nii.gz
- -b
Input bvals file corresponding to the NIfTI file to be denoised. Example:
filename.bval
OPTIONAL ARGUMENTS¶
- -model
Possible choices: ols, ridge, lasso
Type of regression model used for self-supervised training within Patch2Self.
Default: “ols”
- -radius
Patch Radius used to generate p-neighbourhoods within Patch2Self. Notes:
A radius of
0
will use 1x1x1 p-neighbourhoods, a radius of1
will use 3x3x3 p-neighbourhoods, and so on.For anisotropic patch sizes, provide a comma-delimited list of 3 integers. (e.g.
-radius 0,1,0
). For isotropic patch sizes, provide a single int value (e.g.-radius 0
).
Default: “0”
- -o
Name of the output NIFTI image.
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 assnakeviz
).- -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 additionalsnapshot_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.