qsiprep.interfaces.patch2self module

qsiprep.interfaces.patch2self.patch2self(data, bvals, patch_radius=[0, 0, 0], model='ols', b0_threshold=50, out_dtype=None, alpha=1.0, verbose=False, b0_denoising=True, clip_negative_vals=False, shift_intensity=True)[source]

Patch2Self Denoiser

Parameters:
  • data (ndarray) – The 4D noisy DWI data to be denoised.

  • bvals (1D array) – Array of the bvals from the DWI acquisition

  • patch_radius (int or 1D array, optional) – The radius of the local patch to be taken around each voxel (in voxels). Default: 0 (denoise in blocks of 1x1x1 voxels).

  • model (string, or initialized linear model object.) – This will determine the algorithm used to solve the set of linear equations underlying this model. If it is a string it needs to be one of the following: {‘ols’, ‘ridge’, ‘lasso’}. Otherwise, it can be an object that inherits from dipy.optimize.SKLearnLinearSolver or an object with a similar interface from Scikit-Learn: sklearn.linear_model.LinearRegression, sklearn.linear_model.Lasso or sklearn.linear_model.Ridge and other objects that inherit from sklearn.base.RegressorMixin. Default: ‘ols’.

  • b0_threshold (int, optional) – Threshold for considering volumes as b0.

  • out_dtype (str or dtype, optional) – The dtype for the output array. Default: output has the same dtype as the input.

  • alpha (float, optional) – Regularization parameter only for ridge regression model. Default: 1.0

  • verbose (bool, optional) – Show progress of Patch2Self and time taken.

  • b0_denoising (bool, optional) – Skips denoising b0 volumes if set to False. Default: True

  • clip_negative_vals (bool, optional) – Sets negative values after denoising to 0 using np.clip. Default: True

  • shift_intensity (bool, optional) – Shifts the distribution of intensities per volume to give non-negative values Default: False

Returns:

  • denoised array (ndarray) – This is the denoised array of the same size as that of the input data, clipped to non-negative values.

  • noise_level_image (ndarray) – RMS of the estimated noise across all images. A 3D matrix.

References

[patch2self] S. Fadnavis, J. Batson, E. Garyfallidis, Patch2Self:

Denoising Diffusion MRI with Self-supervised Learning, Advances in Neural Information Processing Systems 33 (2020)