EventOperators#
- class torchsim.model.EventOperators(excitation=<function Excitation>, refocusing=<function Refocusing>, inversion=<function Inversion>, saturation=<function Saturation>, readout=<function Readout>, delay=<function Delay>)[source]#
Bases:
objectWhich operator plays each kind of event.
Each field is an operator factory, called with the parameters the protocol has for that event. Assigning one is how a sequence says that its readouts wind the states on, or that its excitation is a shaped pulse rather than an ideal rotation.
These are roles a sequence is written in terms of, not the tags the events end up carrying: a factory here decides which
RfUseand whichEventActionits events are emitted with.Methods
Return time passing, and whatever the sequence plays across it.
Return a pulse that tips magnetization into the transverse plane.
Return an ideal inversion, scaled by the tissue's inversion efficiency.
Return one sample of the transverse magnetization, demodulated by a phase.
Return a pulse the sequence sits between crushers, unless told otherwise.
Return an off-resonance pulse that deposits power in a semisolid pool.
- excitation(phase_rad=0.0, *, duration_s=0.0, definition_id=0, frequency_hz=0.0, shim_id=0, action=EventAction.NONE)#
What a pulse that tips magnetization into the transverse plane plays.
- refocusing(phase_rad=0.0, *, crushed=True, duration_s=0.0, definition_id=0, frequency_hz=0.0, shim_id=0)#
What a refocusing pulse plays, including the gradients it sits between.
- inversion(*, flip_rad=torch.pi, phase_rad=0.0, definition_id=0)#
What an inversion plays, and the recovery it holds the timeline for.
- saturation(flip_rad, *, offset_hz=0.0, phase_rad=0.0, duration_s=0.0, shim_id=0)#
What a saturation pulse plays.
- readout(*, role=AdcRole.SINGLE, is_echo=True, duration_s=0.0, action=EventAction.NONE)#
What a sample and the rest of its repetition play – which is where a sequence says whether it winds the states on, spoils them, or rewinds them.
- delay(*, action=EventAction.NONE)#
What a wait plays, which is nothing but time.