Skip to content

Commit

Permalink
Update bsw_leakagecorr.py (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmaBlomback authored Oct 4, 2024
1 parent 95f0d8f commit 569eba8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def BSWleakagecorr(dR2s, nonenhance_map):
for x in range(nX*nY*nZ):
print("Voxel "+str(x))
if np.all(~np.isnan(dR2s_vec[x,:])) and np.all(~np.isinf(dR2s_vec[x,:])):
BSW_kvals,BSW_fitcov = curve_fit(BSWfunction,(dR2s_WBNE[x,:],dR2s_WBNE_integral),dR2s_vec[x,:],p0)
BSW_kvals,BSW_fitcov = curve_fit(BSWfunction,(dR2s_WBNE_avg,dR2s_WBNE_integral),dR2s_vec[x,:],p0)
K1_dR2s[x] = BSW_kvals[0]
K2_dR2s[x] = BSW_kvals[1]
leakage = (-K2_dR2s[x]) * dR2s_WBNE_integral
dR2s_BSW[x,:] = dR2s_vec[x,:] - leakage;

dR2s_leakagecorrected = np.zeros(dR2s.shape)
dR2s_leakagecorrected = np.reshape(dR2s_BSW,dR2s.shape,order='F')
return dR2s_leakagecorrected
return dR2s_leakagecorrected

0 comments on commit 569eba8

Please sign in to comment.