File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def io_orientation(affine, tol=None):
37
37
threshold below which SVD values of the affine are considered zero. If
38
38
`tol` is None, and ``S`` is an array with singular values for `affine`,
39
39
and ``eps`` is the epsilon value for datatype of ``S``, then `tol` set to
40
- ``S.max() * eps``.
40
+ ``S.max() * max(S.shape) * eps``.
41
41
42
42
Returns
43
43
-------
@@ -62,7 +62,7 @@ def io_orientation(affine, tol=None):
62
62
P , S , Qs = npl .svd (RS )
63
63
# Threshold the singular values to determine the rank.
64
64
if tol is None :
65
- tol = S .max () * np .finfo (S .dtype ).eps
65
+ tol = S .max () * max ( S . shape ) * np .finfo (S .dtype ).eps
66
66
keep = (S > tol )
67
67
R = np .dot (P [:, keep ], Qs [keep ])
68
68
# the matrix R is such that np.dot(R,R.T) is projection onto the
You can’t perform that action at this time.
0 commit comments