// 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]))
fw_params[vox, :3] = evals
fw_params[vox, 3:] = evecs.ravel()
fw_params[vox, 12] = start_params[7]
fw_params[vox, 13] = np.exp(-start_params[6])
After Change
cholesky))
if cholesky:
this_tensor[:6] = cholesky_to_lower_triangular(this_tensor[:6])
this_tensor[7] = 0.5 * (1 + np.sin(this_tensor[7] - np.pi/2))
// The parameters are the evals and the evecs: