Sequence.repetition#
- Sequence.repetition()[source]#
Return the repeating unit of the block table.
- Returns:
size (int) – Blocks per repetition; the whole sequence when it does not repeat, and zero when it has no blocks.
start (int) – 1-based block at which the first repetition starts, always 1.
Notes
The repetition is the shortest period of the block-definition stream from the first block that every later block repeats, the last copy possibly cut short; failing that, the shortest period dividing the table over which blocks match in duration and in the channels they play; failing both, the whole sequence. A slice acquired with its own preparation and dummy shots is therefore one repetition, and a block played once makes the whole sequence one. A
TRsizedefinition shorter than the sequence, dividing it and repeated by the blocks, is taken instead, so a longer hyper-TR can be declared. Nothing is written into the sequence.Examples
>>> import numpy as np >>> import pypulseqpp as pp >>> seq = pp.Sequence(pp.Opts()) >>> pulse = pp.make_block_pulse(np.pi / 2, duration=1e-3) >>> for _ in range(4): ... _ = seq.add_block(pulse) ... _ = seq.add_block(pp.make_delay(10e-3)) >>> seq.repetition() (2, 1) >>> seq.get_definition("TRsize") ''