Skip to content

Commit

Permalink
Fixed references
Browse files Browse the repository at this point in the history
  • Loading branch information
riddhishb committed Aug 4, 2016
1 parent dae5958 commit 3d8252f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
8 changes: 4 additions & 4 deletions dipy/denoise/localpca.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def localpca(arr, sigma, patch_radius=1):
"""
r"""
Local PCA Based Denoising of Diffusion Datasets
Parameters
Expand All @@ -24,9 +24,9 @@ def localpca(arr, sigma, patch_radius=1):
References
----------
[1] Manjon JV, Coupe P, Concha L, Buades A, Collins DL
"Diffusion Weighted Image Denoising Using Overcomplete Local PCA"
PLOS 2013
.. [Manjon13] Manjon JV, Coupe P, Concha L, Buades A, Collins DL
"Diffusion Weighted Image Denoising Using Overcomplete Local PCA"
PLOS 2013
"""

Expand Down
26 changes: 4 additions & 22 deletions dipy/denoise/localpca_slow.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import numpy as np
import scipy as sp
from time import time


def localpca_slow(arr, sigma, patch_radius=1, rician=True):
"""Local PCA Based Denoising of Diffusion Datasets
r"""Local PCA Based Denoising of Diffusion Datasets
Parameters
----------
Expand All @@ -26,8 +24,8 @@ def localpca_slow(arr, sigma, patch_radius=1, rician=True):
References
----------
Diffusion Weighted Image Denoising Using Overcomplete Local PCA
Manjon JV, Coupe P, Concha L, Buades A, Collins DL
.. [Manjon13] Diffusion Weighted Image Denoising Using Overcomplete Local PCA
Manjon JV, Coupe P, Concha L, Buades A, Collins DL
"""

Expand Down Expand Up @@ -118,24 +116,8 @@ def localpca_slow(arr, sigma, patch_radius=1, rician=True):
ord=0))


# the final denoised without rician adaptation
denoised_arr = thetax / theta
# phi = np.linspace(0,15,1000)
# # # we need to find the index of the closest value of arr/sigma from the dataset
# eta_phi = np.sqrt(np.pi/2) * np.exp(-0.5 * phi**2) * (((1 + 0.5 * phi**2) * sp.special.iv(0,0.25 * phi**2) + (0.5 * phi**2) * sp.special.iv(1,0.25 * phi**2))**2)
# # # eta_phi = eta_phi[1:200]
# corrected_arr = np.zeros_like(denoised_arr)
# phi = np.abs(denoised_arr / np.sqrt(sigma))
# phi[np.isnan(phi)] = 0
# opt_diff = np.abs(phi - eta_phi[0])
# for i in range(eta_phi.size):
# print(i)
# if(i!=0):
# new_diff = np.abs(phi - eta_phi[i])
# corrected_arr[new_diff < opt_diff] = i
# opt_diff[new_diff<opt_diff] = new_diff[new_diff<opt_diff]

# corrected_arr = np.sqrt(sigma) * corrected_arr * 15.0/1000.0

return denoised_arr.astype(arr.dtype)

else:
Expand Down

0 comments on commit 3d8252f

Please sign in to comment.