make_rotation#
- pypulseqpp.make_rotation()[source]#
Create a rotation extension event for a block’s gradients.
- Parameters:
*args –
Accepted forms (angles in radians):
(rotation,): a SciPy rotation object, retained by reference.(phi,): rotation about z.(phi, theta):Rz(phi) @ Ry(theta); y is applied first.(axis, angle): rotation about a nonzero three-vector.(quaternion,): four scalar-first components, normalised here.(matrix,): a 3-by-3 rotation matrix.(matrices,): an N-by-3-by-3 stack of rotation matrices.
- Returns:
Event with
type == "rot3D", or one event per stacked matrix.- Return type:
- Raises:
ValueError – For an unrecognised form, zero axis or quaternion, or an angle outside its accepted range:
phiin[-pi, 2*pi),thetaand axis-angle rotations in[-pi, pi].
Notes
Registration caches quaternions by rotation-object identity. Reuse the same object for blocks with the same orientation.