-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When computing inertia tensors, eigenvalues are returned sorted in decreasing order by SVD.
But if we ask for real values, order may change due to non-homogeneous voxelsize!
In spatial_image_analysis.py, change:
coord = coordinates_centering3D(xyz, center)
# compute the variance-covariance matrix (1/N*P.P^T):
cov = compute_covariance_matrix(coord)
# Find the eigen values and vectors.
eig_val, eig_vec = eigen_values_vectors(cov)
# convert to real-world units if asked:
if real:
for i in xrange(3):
eig_val[i] *= np.linalg.norm( np.multiply(eig_vec[i],self._voxelsize) )into
coord = coordinates_centering3D(xyz, center)
# convert to real-world units if asked:
if real:
coord = np.multiply(coord, self._voxelsize) )
# compute the variance-covariance matrix (1/N*P.P^T):
cov = compute_covariance_matrix(coord)
# Find the eigen values and vectors.
eig_val, eig_vec = eigen_values_vectors(cov)to be sure to keep the eigenvector sorted by eigenvalues !
Metadata
Metadata
Assignees
Labels
No labels