denoise
denoise.adaptive_soft_matching

Adaptive Soft Coefficient Matching 
denoise.gibbs

Suppresses Gibbs ringing artefacts of images volumes. 
denoise.localpca

General function to perform PCAbased denoising of diffusion datasets. 

Performs local PCA denoising according to Manjon et al. [1]_. 

Performs PCAbased denoising using the MarcenkoPastur distribution [1]_. 
denoise.nlmeans

Nonlocal means for denoising 3D and 4D images 
denoise.noise_estimate

Probabilistic Identification and Estimation of Noise (PIESNO). 

Standard deviation estimation from local patches 
denoise.non_local_means

Nonlocal means for denoising 3D and 4D images, using 
denoise.patch2self

Patch2Self Denoiser. 
Adaptive Soft Coefficient Matching
Combines two filtered 3Dimages at different resolutions and the original image. Returns the resulting combined image.
ima : the original (not filtered) image fimau : 3D double array,
filtered image with optimized nonlocal means using a small block (suggested:3x3), which corresponds to a “high resolution” filter.
filtered image with optimized nonlocal means using a small block (suggested:5x5), which corresponds to a “low resolution” filter.
that explain the rician noise. Note: In P. Coupe et al. the rician noise was simulated as sqrt((f+x)^2 + (y)^2) where f is the pixel value and x and y are independent realizations of a random variable with Normal distribution, with mean=0 and standard deviation=h
output denoised array which is of the same shape as that of the input
Pierrick Coupe, Jose Manjon, Montserrat Robles, Louis Collins. “Multiresolution NonLocal Means Filter for 3D MR Image Denoising” IET Image Processing, Institution of Engineering and Technology, 2011
Suppresses Gibbs ringing artefacts of images volumes.
Matrix containing one volume (3D) or multiple (4D) volumes of images.
Data axis corresponding to the number of acquired slices. Default is set to the third axis.
Number of neighbour points to access local TV (see note). Default is set to 3.
If True, the input data is replaced with results. Otherwise, returns a new array. Default is set to True.
Split the calculation to a pool of children processes. This only
applies to 3D or 4D data arrays. Default is 1. If < 0 the maximal
number of cores minus num_processes + 1
is used (enter 1 to use
as many cores as possible). 0 raises an error.
Matrix containing one volume (3D) or multiple (4D) volumes of corrected images.
For 4D matrix last element should always correspond to the number of diffusion gradient directions.
Please cite the following articles .. [1] Neto Henriques, R., 2018. Advanced Methods for Diffusion MRI Data
Analysis and their Application to the Healthy Ageing Brain (Doctoral thesis). https://doi.org/10.17863/CAM.29356
General function to perform PCAbased denoising of diffusion datasets.
Array of data to be denoised. The dimensions are (X, Y, Z, N), where N are the diffusion gradient directions. The first 3 dimension must have size >= 2 * patch_radius + 1 or size = 1.
Standard deviation of the noise estimated from the data. If no sigma is given, this will be estimated based on random matrix theory [1]_,[2]_
A mask with voxels that are true inside the brain and false outside of it. The function denoises within the true part and returns zeros outside of those voxels.
The radius of the local patch to be taken around each voxel (in voxels). E.g. patch_radius=2 gives 5x5x5 patches.
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.
Thresholding of PCA eigenvalues is done by nulling out eigenvalues that are smaller than:
tau_{factor} can be set to a predefined values (e.g. tau_{factor} = 2.3 [3]), or automatically calculated using random matrix theory (in case that tau_{factor} is set to None).
If true, the Standard deviation of the noise will be returned.
The dtype for the output array. Default: output has the same dtype as the input.
If true, suppress warning caused by patch_size < arr.shape[1].
This is the denoised array of the same size as that of the input data, clipped to nonnegative values.
Veraart J, Novikov DS, Christiaens D, Adesaron B, Sijbers, Fieremans E, 2016. Denoising of Diffusion MRI using random matrix theory. Neuroimage 142:394406. doi: 10.1016/j.neuroimage.2016.08.016
Veraart J, Fieremans E, Novikov DS. 2016. Diffusion MRI noise mapping using random matrix theory. Magnetic Resonance in Medicine. doi: 10.1002/mrm.26059.
Manjon JV, Coupe P, Concha L, Buades A, Collins DL (2013) Diffusion Weighted Image Denoising Using Overcomplete Local PCA. PLoS ONE 8(9): e73021. https://doi.org/10.1371/journal.pone.0073021
Performs local PCA denoising according to Manjon et al. [1]_.
Array of data to be denoised. The dimensions are (X, Y, Z, N), where N are the diffusion gradient directions.
Standard deviation of the noise estimated from the data. If not given, calculate using method in [1]_.
A mask with voxels that are true inside the brain and false outside of it. The function denoises within the true part and returns zeros outside of those voxels.
The radius of the local patch to be taken around each voxel (in voxels). E.g. patch_radius=2 gives 5x5x5 patches.
gradient information for the data gives us the bvals and bvecs of diffusion data, which is needed to calculate noise level if sigma is not provided.
The radius of the local patch to be taken around each voxel (in voxels) for estimating sigma. E.g. patch_radius_sigma=2 gives 5x5x5 patches.
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.
Thresholding of PCA eigenvalues is done by nulling out eigenvalues that are smaller than:
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 MarcenkoPastur distribution [2]_. Default: 2.3 according to [1]_.
If true, a noise standard deviation estimate based on the MarcenkoPastur distribution is returned [2]_.
Whether to correct for bias due to Rician noise. This is an implementation of equation 8 in [1]_.
The dtype for the output array. Default: output has the same dtype as the input.
If true, suppress warning caused by patch_size < arr.shape[1].
This is the denoised array of the same size as that of the input data, clipped to nonnegative values
Manjon JV, Coupe P, Concha L, Buades A, Collins DL (2013) Diffusion Weighted Image Denoising Using Overcomplete Local PCA. PLoS ONE 8(9): e73021. https://doi.org/10.1371/journal.pone.0073021
Veraart J, Novikov DS, Christiaens D, Adesaron B, Sijbers, Fieremans E, 2016. Denoising of Diffusion MRI using random matrix theory. Neuroimage 142:394406. doi: 10.1016/j.neuroimage.2016.08.016
Performs PCAbased denoising using the MarcenkoPastur distribution [1]_.
Array of data to be denoised. The dimensions are (X, Y, Z, N), where N are the diffusion gradient directions.
A mask with voxels that are true inside the brain and false outside of it. The function denoises within the true part and returns zeros outside of those voxels.
The radius of the local patch to be taken around each voxel (in voxels). E.g. patch_radius=2 gives 5x5x5 patches.
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.
If true, a noise standard deviation estimate based on the MarcenkoPastur distribution is returned [2]_.
The dtype for the output array. Default: output has the same dtype as the input.
If true, suppress warning caused by patch_size < arr.shape[1].
This is the denoised array of the same size as that of the input data, clipped to nonnegative values
Estimate of the spatial varying standard deviation of the noise
Veraart J, Novikov DS, Christiaens D, Adesaron B, Sijbers, Fieremans E, 2016. Denoising of Diffusion MRI using random matrix theory. Neuroimage 142:394406. doi: 10.1016/j.neuroimage.2016.08.016
Veraart J, Fieremans E, Novikov DS. 2016. Diffusion MRI noise mapping using random matrix theory. Magnetic Resonance in Medicine. doi: 10.1002/mrm.26059.
Nonlocal means for denoising 3D and 4D images
The array to be denoised
mask : 3D ndarray sigma : float or 3D array
standard deviation of the noise estimated from the data
patch size is 2 x patch_radius + 1
. Default is 1.
block size is 2 x block_radius + 1
. Default is 5.
If True the noise is estimated as Rician, otherwise Gaussian noise is assumed.
Number of threads to be used for OpenMP parallelization. If None (default) the value of OMP_NUM_THREADS environment variable is used if it is set, otherwise all available threads are used. If < 0 the maximal number of threads minus num_threads + 1 is used (enter 1 to use as many threads as possible). 0 raises an error.
the denoised arr
which has the same shape as arr
.
Descoteaux, Maxime and WiestDaesslé, Nicolas and Prima, Sylvain and Barillot, Christian and Deriche, Rachid Impact of Rician Adapted NonLocal Means Filtering on HARDI, MICCAI 2008
Probabilistic Identification and Estimation of Noise (PIESNO).
The magnitude signals to analyse. The last dimension must contain the same realisation of the volume, such as dMRI or fMRI data.
The number of phase array coils of the MRI scanner. If your scanner does a SENSE reconstruction, ALWAYS use N=1, as the noise profile is always Rician. If your scanner does a GRAPPA reconstruction, set N as the number of phase array coils.
Probabilistic estimation threshold for the gamma function.
number of initial estimates for sigma to try.
Maximum number of iterations to execute if convergence is not reached.
Tolerance for the convergence criterion. Convergence is reached if two subsequent estimates are smaller than eps.
If True, return a mask identifying all the pure noise voxel that were found.
The estimated standard deviation of the gaussian noise.
A boolean mask indicating the voxels identified as pure noise.
This function assumes two things : 1. The data has a noisy, nonmasked background and 2. The data is a repetition of the same measurements along the last axis, i.e. dMRI or fMRI data, not structural data like T1/T2.
This function processes the data slice by slice, as originally designed in the paper. Use it to get a slice by slice estimation of the noise, as in spinal cord imaging for example.
Koay CG, Ozarslan E and Pierpaoli C.
“Probabilistic Identification and Estimation of Noise (PIESNO): A selfconsistent approach and its applications in MRI.” Journal of Magnetic Resonance 2009; 199: 94103.
Koay CG, Ozarslan E and Basser PJ.
“A signal transformational framework for breaking the noise floor and its applications in MRI.” Journal of Magnetic Resonance 2009; 197: 108119.
Standard deviation estimation from local patches
The array to be estimated
If True, uses all voxels for the estimation, otherwise, only nonzeros voxels are used. Useful if the background is masked by the scanner.
Number of coils of the receiver array. Use N = 1 in case of a SENSE reconstruction (Philips scanners) or the number of coils for a GRAPPA reconstruction (Siemens and GE). Use 0 to disable the correction factor, as for example if the noise is Gaussian distributed. See [1] for more information.
standard deviation of the noise, one estimation per volume.
This function is the same as manually taking the standard deviation of the
background and gives one value for the whole 3D array.
It also includes the coildependent correction factor of Koay 2006
(see [1]_, equation 18) with theta = 0.
Since this function was introduced in [2]_ for T1 imaging,
it is expected to perform ok on diffusion MRI data, but might oversmooth
some regions and leave others undenoised for spatially varying noise
profiles. Consider using piesno()
to estimate sigma instead if visual
inaccuracies are apparent in the denoised result.
Koay, C. G., & Basser, P. J. (2006). Analytically exact correction
scheme for signal extraction from noisy magnitude MR signals. Journal of Magnetic Resonance), 179(2), 31722.
Coupe, P., Yger, P., Prima, S., Hellier, P., Kervrann, C., Barillot,
C., 2008. An optimized blockwise nonlocal means denoising filter for 3D magnetic resonance images, IEEE Trans. Med. Imaging 27, 42541.
blockwise averaging approach
The array to be denoised
mask : 3D ndarray sigma : float
standard deviation of the noise estimated from the data
patch size is 2 x patch_radius + 1
. Default is 1.
block size is 2 x block_radius + 1
. Default is 5.
If True the noise is estimated as Rician, otherwise Gaussian noise is assumed.
the denoised arr
which has the same shape as arr
.
P. Coupe, P. Yger, S. Prima, P. Hellier, C. Kervrann, C. Barillot, An Optimized Blockwise Non Local Means Denoising Filter for 3D Magnetic Resonance Images, IEEE Transactions on Medical Imaging, 27(4):425441, 2008
Pierrick Coupe, Jose Manjon, Montserrat Robles, Louis Collins. Adaptive Multiresolution NonLocal Means Filter for 3D MR Image Denoising IET Image Processing, Institution of Engineering and Technology, 2011
Patch2Self Denoiser.
The 4D noisy DWI data to be denoised.
Array of the bvals from the DWI acquisition
The radius of the local patch to be taken around each voxel (in voxels). Default: 0 (denoise in blocks of 1x1x1 voxels).
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 ScikitLearn: sklearn.linear_model.LinearRegression, sklearn.linear_model.Lasso or sklearn.linear_model.Ridge and other objects that inherit from sklearn.base.RegressorMixin. Default: ‘ols’.
Threshold for considering volumes as b0.
The dtype for the output array. Default: output has the same dtype as the input.
Regularization parameter only for ridge regression model.
Show progress of Patch2Self and time taken.
Skips denoising b0 volumes if set to False.
Sets negative values after denoising to 0 using np.clip.
Shifts the distribution of intensities per volume to give nonnegative values
This is the denoised array of the same size as that of the input data, clipped to nonnegative values.
Denoising Diffusion MRI with Selfsupervised Learning, Advances in Neural Information Processing Systems 33 (2020)