// Invert f transformation if this was requested
if f_transform:
this_tensor[7] = 0.5 * (1 + np.sin(this_tensor[7] - np.pi/2))
// The parameters are the evals and the evecs:
evals, evecs = decompose_tensor(from_lower_triangular(this_tensor[:6]))
After Change
// If leastsq failed to converge and produced nans, we"ll resort to the
// WLS solution in this voxel:
except np.linalg.LinAlgError:
evals, evecs = decompose_tensor(
from_lower_triangular(start_params[:6]))
// Process water volume fraction f
if f_transform:
f = 0.5 * (1 + np.sin(f - np.pi/2))