transform_system¶
- odl.tomo.util.utility.transform_system(principal_vec, principal_default, other_vecs, matrix=None)[source]¶
Transform vectors with either
matrixor based onprincipal_vec.The logic of this function is as follows:
If
matrixis notNone, transformprincipal_vecand all vectors inother_vecsbymatrix, ignoringprincipal_default.If
matrixisNone, compute the rotation matrix fromprincipal_defaulttoprincipal_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
matrixif given.- Parameters:
- principal_vec
array-like, shape(ndim,) Vector that defines the transformation if
matrixis not provided.- principal_default
array-like, shape(ndim,) Default value for
principal_vec. The deviation from this determines the transformation. Ifmatrixis given, this has no effect.- other_vecssequence of
Noneorarray-like's with shape(ndim,) The other vectors that should be transformed.
Noneentries 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