TransformFOV

Contents

TransformFOV#

class pypulseqpp.TransformFOV[source]#

Bases: object

Geometry prescription applied to an existing sequence.

Scales gradient amplitudes per logical axis, translates the field of view in logical metres, 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.

  • translation (Sequence[float], default=None) – Three offsets in logical coordinates, in metres.

  • scale (Sequence[float], default=None) – Gradient amplitude multipliers along the three logical 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 to logical coordinates 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 a block that carries a rotation R by the gradients it plays, R g, rather than by the gradients it draws, g. The first is the logical frame of a design whose rotations are its own, such as the spokes of a radial readout; the second, of a sequence whose rotations are a prescription composed onto it.

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

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

  • swept_k (tuple[float, float, float]) – Cumulative logical gradient area, in 1/m, 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 in unrotated logical coordinates, in 1/m.