You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support configurable rotation order in create_rotate (#8963)
Fixes#6029 .
### Description
`create_rotate` hard-coded 3D rotations to the intrinsic `Rx @ Ry @ Rz`
composition. This adds a `rotate_order` parameter following the
convention of `scipy.spatial.transform.Rotation.from_euler`: a string of
up to three axes from `{x, y, z}`, where lower case selects extrinsic
rotations (about the fixed world axes) and upper case selects intrinsic
rotations (about the moving body axes). The default `"XYZ"` reproduces
the previous behaviour exactly, so existing pipelines are unaffected.
The name avoids collision with the spline interpolation order already
selected via `mode`. The parameter is threaded through
`functional.rotate`, `Rotate`, `RandRotate`, `AffineGrid`,
`RandAffineGrid`, `Affine`, `RandAffine` and their dictionary variants.
Invalid sequences raise `ValueError`, and 2D inputs ignore it.
A new test module checks that the default matches the legacy matrix,
that every supported axis sequence matches scipy for both the numpy and
torch backends, that invalid sequences raise, that 2D inputs ignore the
order, and that the `Rotate` transform honours it while remaining
invertible.
### Types of changes
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [x] New tests added to cover the changes.
- [x] In-line docstrings updated.
---------
Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
0 commit comments