def tensor_spherical_to_cartesian(theta, phi, psi):
"""Calculate the eigenvectors for a Tensor given the three angles.
This will return the eigenvectors unsorted, since this function knows nothing about the eigenvalues. The caller
of this function will have to sort them by eigenvalue if necessary.
Args:
theta (ndarray): matrix of list of theta's
phi (ndarray): matrix of list of phi's
psi (ndarray): matrix of list of psi's
Returns:
tuple: The three eigenvector for every voxel given. The return matrix for every eigenvector is of the given
shape + [3].
"""
v0 = spherical_to_cartesian(theta, phi)
v1 = rotate_orthogonal_vector(v0, spherical_to_cartesian(theta + np.pi / 2.0, phi), psi)
v2 = np.cross(v0, v1)
return v0, v1, v2
评论列表
文章目录