Command line#
patch-denoise
minimally requires a path to a NIfTI file,
but it can take advantage of reconstructed phase data and/or noise volumes.
usage: patch-denoise [-h] [--version]
[--method {None,mp-pca,hybrid-pca,raw,optimal-fro,optimal-fro-noise,optimal-nuc,optimal-ope,nordic,adaptive-qut}]
[--patch-shape INT] [--patch-overlap INT]
[--recombination {mean,weighted}] [--mask-threshold INT]
[--conf CONF] [--extra key=value [key=value ...]]
[--mask FILE|auto] [--noise-map FILE]
[--input-phase FILE] [--time-slice TIME_SLICE]
[--output-noise-map FILE] [--nan-to-num VALUE] [-v]
input_file [output_file]
Positional Arguments#
- input_file
Input (noisy) file.
- output_file
Output (denoised) file. Default is D<input_file_name>.
Named Arguments#
- --version
show program’s version number and exit
Denoising parameters#
- --method
Possible choices: None, mp-pca, hybrid-pca, raw, optimal-fro, optimal-fro-noise, optimal-nuc, optimal-ope, nordic, adaptive-qut
Denoising method. Available denoising methods:
mp-pca, hybrid-pca, raw, optimal-fro, optimal-fro-noise, optimal-nuc, optimal-ope, nordic, adaptive-qut.
This parameter is mutually exclusive with –conf.
Default:
'optimal-fro'
- --patch-shape
Patch shape. If int, this is the size of the patch in each dimension. If not specified, the default value is used. Note: setting a low aspect ratio will increase the number of patches to be processed, and will increase memory usage and computation times. This parameter should be used in conjunction with –method and is mutually exclusive with –conf.
Default:
11
- --patch-overlap
Patch overlap. If int, this is the size of the overlap in each dimension. If not specified, the default value is used. Note: setting a low overlap will increase the number of patches to be processed, and will increase memory usage and computation times. This parameter should be used in conjunction with –method and is mutually exclusive with –conf.
Default:
5
- --recombination
Possible choices: mean, weighted
Recombination method. If ‘mean’, the mean of the overlapping patches is used. If ‘weighted’, the weighted mean of the overlapping patches is used. This parameter should be used in conjunction with –method and is mutually exclusive with –conf.
Default:
'weighted'
- --mask-threshold
Mask threshold. If int, this is the threshold for the mask. If not specified, the default value is used. This parameter should be used in conjunction with –method and is mutually exclusive with –conf.
Default:
10
- --conf
Denoising configuration. Format should be <name>_<patch-size>_<patch-overlap>_<recombination>_<mask_threshold>. See Documentation of ‘DenoiseParameter.from_str’ for full specification. Available denoising methods:
mp-pca, hybrid-pca, raw, optimal-fro, optimal-fro-noise, optimal-nuc, optimal-ope, nordic, adaptive-qut.
This parameter is mutually exclusive with –method.
- --extra
extra key=value arguments for denoising methods.
Additional input data#
- --mask
mask file, if auto or not provided it would be determined from the average image.
- --noise-map
noise map estimation file
- --input-phase
Phase of the input data. This MUST be in radians. No conversion would be applied.
Miscellaneous options#
- --time-slice
Slice across time. If <N>x the patch will be N times longer in space than in time If int, this is the size of the time dimension patch. If not specified, the whole time series is used. Note: setting a low aspect ratio will increase the number of patch to beprocessed, and will increase memory usage and computation times.
- --output-noise-map
Output name for calculated noise map
- --nan-to-num
Replace NaN by the provided value.
- -v, --verbose
Increase verbosity level. You can provide multiple times (e.g., -vvv).
Default:
0
Using patch-denoise on BIDS data#
Warning
These examples assume that the phase data are in radians. If they are in arbitrary units, you will need to rescale them before running patch-denoise.
Magnitude only#
patch-denoise \
sub-01/func/sub-01_task-rest_part-mag_bold.nii.gz \
sub-01_task-rest_part-mag_desc-denoised_bold.nii.gz \
--mask auto \
--method optimal-fro \
--patch-shape 11 \
--patch-overlap 5 \
--recombination weighted \
--mask-threshold 1
Magnitude with noise volumes#
patch-denoise \
sub-01/func/sub-01_task-rest_part-mag_bold.nii.gz \
sub-01_task-rest_part-mag_desc-denoised_bold.nii.gz \
--noise-map sub-01/func/sub-01_task-rest_part-mag_noRF.nii.gz \
--mask auto \
--method optimal-fro \
--patch-shape 11 \
--patch-overlap 5 \
--recombination weighted \
--mask-threshold 1
Magnitude and phase#
patch-denoise \
sub-01/func/sub-01_task-rest_part-mag_bold.nii.gz \
sub-01_task-rest_part-mag_desc-denoised_bold.nii.gz \
--input-phase sub-01/func/sub-01_task-rest_part-phase_bold.nii.gz \
--mask auto \
--method optimal-fro \
--patch-shape 11 \
--patch-overlap 5 \
--recombination weighted \
--mask-threshold 1
Magnitude and phase with noise volumes#
patch-denoise \
sub-01/func/sub-01_task-rest_part-mag_bold.nii.gz \
sub-01_task-rest_part-mag_desc-denoised_bold.nii.gz \
--input-phase sub-01/func/sub-01_task-rest_part-phase_bold.nii.gz \
--noise-map sub-01/func/sub-01_task-rest_part-mag_noRF.nii.gz \
--noise-map-phase sub-01/func/sub-01_task-rest_part-phase_noRF.nii.gz \
--mask auto \
--method optimal-fro \
--patch-shape 11 \
--patch-overlap 5 \
--recombination weighted \
--mask-threshold 1