# dipy_denoise_lpca

## Synopsis

Workflow wrapping LPCA denoising method.

See [1] for further details about the method.

## Usage

    dipy_denoise_lpca [OPTIONS] input_files bvalues_files bvectors_files

## Input Parameters

- `input_files`

  Path to the input volumes. This path may contain wildcards to process multiple inputs at once.

- `bvalues_files`

  Path to the bvalues files. This path may contain wildcards to use multiple bvalues files at once.

- `bvectors_files`

  Path to the bvectors files. This path may contain wildcards to use multiple bvectors files at once.

## General Options

- `--sigma`

  Standard deviation of the noise estimated from the data. 0 means sigma value estimation following the algorithm in Manjón et al.[2]. (default: 0)

- `--b0_threshold`

  Threshold used to find b0 volumes. (default: 50)

- `--bvecs_tol`

  Threshold used to check that norm(bvec) = 1 +/- bvecs_tol b-vectors are unit vectors. (default: 0.01)

- `--patch_radius`

  The radius of the local patch to be taken around each voxel (in voxels) For example, for a patch radius with value 2, and assuming the input image is a 3D image, the denoising will take place in blocks of 5x5x5 voxels. (default: 2)

- `--pca_method`

  Use either eigenvalue decomposition (‘eig’) or singular value decomposition (‘svd’) for principal component analysis. The default method is ‘eig’ which is faster. However, occasionally ‘svd’ might be more accurate. (default: eig)

- `--tau_factor`

  Thresholding of PCA eigenvalues is done by nulling out eigenvalues that are smaller than:

  \[\tau = (\tau_{factor} \sigma)^2\]

  \(\tau_{factor}\) can be change to adjust the relationship between the noise standard deviation and the threshold \(\tau\). If \(\tau_{factor}\) is set to None, it will be automatically calculated using the Marcenko-Pastur distribution :footcite:p`Veraart2016b`. (default: 2.3)

## Output Options

- `--out_dir`

  Output directory. (default: current directory)

- `--out_denoised`

  Name of the resulting denoised volume. (default: dwi_lpca.nii.gz)

## References

[1]

Jelle Veraart, Els Fieremans, Ileana O. Jelescu, Florian Knoll, and Dmitry S. Novikov. Gibbs ringing in diffusion MRI. Magnetic Resonance in Medicine, 76(1):301–314, July 2016. URL: https://doi.org/10.1002/mrm.25866, doi:10.1002/mrm.25866.

[2]

José V. Manjón, Pierrick Coupé, Luis Concha, Antonio Buades, D. Louis Collins, and Montserrat Robles. Diffusion Weighted Image Denoising Using Overcomplete Local PCA. PLOS ONE, 8(9):e73021, 2013. URL: https://doi.org/10.1371/journal.pone.0073021, doi:10.1371/journal.pone.0073021.

Garyfallidis, E., M. Brett, B. Amirbekian, A. Rokem, S. Van Der Walt, M. Descoteaux, and I. Nimmo-Smith. Dipy, a library for the analysis of diffusion MRI data. Frontiers in Neuroinformatics, 1-18, 2014.