magtomo.Reconstruction.rotate#
- rotate(config, rot_matrix, order=1)#
Applies an affine rotation described by the matrix rot_matrix about the center of the object.
If the object has the shape (x, y, z) i.e. is three-dimensional, then the rotation is applied as expected. If the shape has the shape (n, x, y, z), i.e. multiple components need to be rotated, the rotation matrix is transformed into a 4x4 matrix given by [1, rot_matrix]
- Parameters:
- confignp.ndarray
The object to be rotated. Must have shape (x, y, z) or (n, x, y, z)
- rot_matrixnp.ndarray
The rotation matrix describing the operation to be applied.
- orderint
The interpolation order of the affine transformation (0 - 5).
- Returns:
- np.ndarray
The rotated object (same shape as config).