Skip to content

Commit

Permalink
Remove hardcoded number of echoes from Kappa/Rho calculations.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Jul 24, 2018
1 parent 433338b commit fe948b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tedana/model/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ def fitmodels_direct(catd, mmix, mask, t2s, t2sG, tes, combmode, ref_img,
coeffs_S0 = (B * X1).sum(axis=0) / (X1**2).sum(axis=0)
SSE_S0 = (B - X1 * np.tile(coeffs_S0, (n_echos, 1)))**2
SSE_S0 = SSE_S0.sum(axis=0)
F_S0 = (alpha - SSE_S0) * 2 / (SSE_S0)
F_S0 = (alpha - SSE_S0) * (n_echos - 1) / (SSE_S0)
F_S0_maps[:, i] = F_S0

# R2 Model
coeffs_R2 = (B * X2).sum(axis=0) / (X2**2).sum(axis=0)
SSE_R2 = (B - X2 * np.tile(coeffs_R2, (n_echos, 1)))**2
SSE_R2 = SSE_R2.sum(axis=0)
F_R2 = (alpha - SSE_R2) * 2 / (SSE_R2)
F_R2 = (alpha - SSE_R2) * (n_echos - 1) / (SSE_R2)
F_R2_maps[:, i] = F_R2

# compute weights as Z-values
Expand Down

0 comments on commit fe948b0

Please sign in to comment.