Sequence.block_definitions

Sequence.block_definitions#

Sequence.block_definitions()[source]#

Return the definition each block was deduplicated onto.

Entry i is block i + 1, and the value is a definition id counted from 1. Blocks sharing a definition play the same events for the same duration; the per-playout parameters are what separate them.

The events a block plays and its duration make the definition. The ADC does not, so a block playing an imaging block’s gradients with the ADC absent shares its definition; neither do labels or a rotation. A block that plays nothing is one definition whatever its duration, but a block carrying a trigger or a digital output is not.

Returns:

(n,), by block.

Return type:

NDArray[np.int32]

Examples

>>> import pypulseqpp as pp
>>> seq = pp.Sequence(pp.Opts())
>>> gx = pp.make_trapezoid("x", amplitude=1e5, rise_time=1e-4, flat_time=1e-3)
>>> for amplitude in (1e5, -1e5):
...     gx.amplitude = amplitude
...     _ = seq.add_block(gx)
>>> seq.block_definitions().tolist()  # one position, two amplitudes
[1, 1]