TransformFOV.apply_to_sequence#
- TransformFOV.apply_to_sequence()[source]#
Apply the scaling, translation and rotation, in that order, and return the sequence.
NOSCL,NOROTandNOPOSlabels exempt blocks from the respective operations. Labels are evaluated from the selected range’s start, without inheriting values from earlier blocks. A nonzero translation still integrates exempt blocks.- Parameters:
seq (Sequence) – Sequence to transform.
time_range (Sequence[float], default=None) – Start and end times in seconds; selects all blocks they touch.
block_range (Sequence[int], default=None) – Inclusive, 1-based block range; mutually exclusive with
time_range. Translation starts from this object’s stored state, not from a scan of preceding blocks.in_place (bool, default=False) – Modify
seqrather than a copy. Nonzero translation updates this object’s state in either case.
- Returns:
Transformed sequence;
seqitself whenin_place=True.- Return type:
Examples
>>> import pypulseqpp as pp >>> seq = pp.Sequence(pp.Opts()) >>> seq.add_block(pp.make_trapezoid("x", area=1000, duration=2e-3)) 1 >>> shift = pp.TransformFOV(translation=(0.01, 0, 0)) >>> shift.apply_to_sequence(seq, in_place=True) is seq True >>> round(shift.swept_k[0], 6) 1000.0