transform_system¶
- odl.tomo.util.utility.transform_system(principal_vec, principal_default, other_vecs, matrix=None)[source]¶
Transform vectors with either
matrix
or based onprincipal_vec
.The logic of this function is as follows:
If
matrix
is notNone
, transformprincipal_vec
and all vectors inother_vecs
bymatrix
, ignoringprincipal_default
.If
matrix
isNone
, compute the rotation matrix fromprincipal_default
toprincipal_vec
, not including the dilation. Apply that rotation to all vectors inother_vecs
.
Note: All vectors must have the same shape and match the shape of
matrix
if given.- Parameters:
- principal_vec
array-like
, shape(ndim,)
Vector that defines the transformation if
matrix
is not provided.- principal_default
array-like
, shape(ndim,)
Default value for
principal_vec
. The deviation from this determines the transformation. Ifmatrix
is given, this has no effect.- other_vecssequence of
None
orarray-like
's with shape(ndim,)
The other vectors that should be transformed.
None
entries are just appended as-is.- matrix
array-like
, shape(ndim, ndim)
, optional Explicit transformation matrix to be applied to the vectors. It is allowed to include a constant scaling but shouldn't have strongly varying directional scaling (bad condition).
- principal_vec
- Returns:
- transformed_vecstuple of
numpy.ndarray
, shape(ndim,)
The transformed vectors. The first entry is (the transformed)
principal_vec
, followed by the transformedother_vecs
. Thus the length of the tuple islen(other_vecs) + 1
.
- transformed_vecstuple of