align#
- pypulseqpp.align()[source]#
Sets delays of the objects within the block to achieve the desired alignment of the objects in the block. Aligns objects as per specified alignment options by setting delays of the pulse sequence events within the block. All previously configured delays within objects are taken into account during calculating of the block duration but then reset according to the selected alignment. Possible values for align_spec are ‘left’, ‘center’, ‘right’.
- Parameters:
args (dict{str, [SimpleNamespace, ...]}) – Dictionary mapping of alignment options and SimpleNamespace objects. Format: alignment_spec1=SimpleNamespace, alignment_spec2=[SimpleNamespace, …], … Alignment spec must be one of left, center or right.
- Returns:
objects – List of aligned SimpleNamespace objects.
- Return type:
[SimpleNamespace, …]
- Raises:
ValueError – If first parameter is not of type str. If invalid alignment spec is passed. Must be one of left, center or right.
Examples
al_grad1, al_grad2, al_grad3 = align(right=[grad1, grad2, grad3])
Notes
This is PyPulseq’s function. Events go in as the namespaces it expects and come back with their fields in slots.