TransformFOV

Contents

TransformFOV#

class pypulseqpp.TransformFOV[source]#

Bases: object

Geometry prescription applied to an existing sequence.

Scales gradient amplitudes per channel axis, translates the field of view in metres along the channel axes, or the logical axes with through_rotation, and composes a rotation after each block’s own rotation; a rotation given with a translation does not turn it. Field of view scales inversely with gradient amplitude, so halving an axis’s scale doubles the field of view along it.

Parameters:
  • rotation (ArrayLike | Rotation, default=None) – Prescription orientation as a 3-by-3 matrix or SciPy rotation. Composed after the rotation already attached to each block. A matrix with determinant -1 is played as the rotation rotation @ diag(1, 1, -1) after negating the gradient on channel axis z, with each block’s own rotation conjugated by that reflection; see reflected_axis.

  • translation (Sequence[float], default=None) – Three offsets in metres, along the channel axes, or along the logical axes with through_rotation.

  • scale (Sequence[float], default=None) – Gradient amplitude multipliers along the three channel axes. A factor of zero disables encoding on that axis.

  • transform (ArrayLike, default=None) – 4-by-4 homogeneous matrix, mutually exclusive with rotation and translation. Its translation is in the output frame and is converted into the frame of translation using the transpose of its rotation.

  • use_rotation_extension (bool, default=True) – Must be True; waveform-baked rotation is not implemented.

  • through_rotation (bool, default=False) – Translate along the logical axes: a block that carries a rotation R is translated by the gradients it plays, R g, rather than by those on its channel axes, g. The first suits a design whose rotations are its own, such as the spokes of a radial readout; the second, a sequence whose rotations are a prescription composed onto it.

  • system (Opts, default=None) – Stored for compatibility; not used to validate transformed events.

Attributes:
  • quaternion (NDArray[np.float64] | None) – Scalar-first unit quaternion of the prescription’s rotation.

  • reflected_axis (int | None) – Channel axis whose gradient is negated to play an improper rotation: 2, for z. None for a proper one.

  • block_k_origin (tuple[float, float, float]) – k-space position entering the next processed range, in 1/m, in the frame of the translation. Reset at excitation and inverted at refocusing, at the RF centre.

  • swept_k (tuple[float, float, float]) – Cumulative gradient area, in 1/m, in the frame of the translation, without RF resets. RF and ADC shift phases share this reference.

Notes

A nonzero translation updates both state vectors. Reuse them only for consecutive ranges; initialise them to the state entering the first selected block. Block ranges do not automatically integrate preceding blocks.

Examples

>>> import pypulseqpp as pp
>>> seq = pp.Sequence(pp.Opts())
>>> seq.add_block(pp.make_trapezoid("y", area=500, duration=2e-3))
1
>>> halved = pp.TransformFOV(scale=(1, 0.5, 1)).apply_to_sequence(seq)
>>> halved.get_block(1).gy.amplitude == 0.5 * seq.get_block(1).gy.amplitude
True

Methods

apply_to_seq

The reference toolbox's name for the same thing.

apply_to_sequence

Apply scaling, translation, then rotation.

trajectories

Return ADC trajectories on the channel axes, in 1/m.