Sequence.rf_gradients

Sequence.rf_gradients#

Sequence.rf_gradients()[source]#

Return the gradient each RF pulse plays under, along the channel axes.

One entry per block with RF, in play order, before the block’s rotation. An axis is steady when its gradient holds one value from the pulse’s first sample to its last: TransformFOV moves such a pulse by a frequency and a phase offset alone, and writes a phase shape for one under a gradient that is not.

Returns:

Block indices, steadiness flags and gradient amplitudes at the pulse centre, in Hz/m.

Return type:

RfGradients

Examples

>>> import numpy as np
>>> import pypulseqpp as pp
>>> seq = pp.Sequence(pp.Opts())
>>> pulse, gz, _ = pp.make_sinc_pulse(
...     np.pi / 2, duration=2e-3, slice_thickness=5e-3, return_gz=True
... )
>>> _ = seq.add_block(pulse, gz)
>>> under = seq.rf_gradients()
>>> under.steady.tolist()
[[True, True, True]]
>>> bool(np.isclose(under.gradient[0, 2], gz.amplitude))
True