TrueFISPSimulator#
- class torchsim.simulators.TrueFISPSimulator(*args, **kwargs)[source]#
Bases:
SimulatorA balanced SSFP train from equilibrium, optionally inverted first.
The pulses alternate in phase and each sample is demodulated by the phase of its own pulse. An alpha/2 pulse of opposite phase, played before the train, damps the oscillation of the approach to the steady state [1]; after an inversion, the train is the inversion-recovery TrueFISP whose recovery curve carries T1, T2 and the proton density together [2]. Every pulse is a windowed sinc played sample by sample, so the magnetization relaxes, precesses off resonance and exchanges between pools while it plays, unless
pulse_durationis zero and each is an instantaneous rotation. This is the sequence BART’ssimplays asBSSFPandIR-BSSFP, and with instantaneous pulses the one itsepgplays as bSSFP.References
Examples
from torchsim.simulators import TrueFISPSimulator sequence = TrueFISPSimulator( flip=45.0, TR=4.5, nshots=200, inversion="adiabatic" ) signal = sequence.simulate(T1=1000.0, T2=100.0) print(signal.shape)
torch.Size([200])
Methods
bindThis simulator with more fixed on it, values or settings alike.
describeReturn the description this protocol plays.
evaluateRun one simulation of the described protocol.
from_descriptionReturn a simulator over a stream someone else assembled.
from_pulseqReturn a simulator over one repetition of a Pulseq sequence.
jacobianReturn the signal and its derivative with respect to
diff.Return the train, one sample per shot.
playedReturn the protocol as it will be laid out.
repetition_sReturn how long one repetition lasts, given what the layout played.
simulateReturn the recorded signal.
- layout(*, flip, TR, nshots, TE=None, pulse_duration=1.0, bandwidth_time=4.0, half_alpha=True, preparation=None, inversion=None, inversion_duration=10.0, inversion_phase=0.0, spoiler=0.0, dwell=0.01)[source]#
Return the train, one sample per shot.
- Parameters:
flip (float or array-like) – Flip angle in degrees, scalar or one per shot.
TR (float) – Repetition time in milliseconds, pulse centre to pulse centre.
nshots (int) – Excitations in the train.
TE (float, optional) – Echo time in milliseconds, from the centre of the pulse; half the repetition time when not given, where a balanced train refocuses.
pulse_duration (float, optional) – Duration of each pulse in milliseconds. Zero plays each as an instantaneous rotation.
bandwidth_time (float, optional) – Zero crossings of the Hamming-windowed sinc across the pulse.
half_alpha (bool, optional) – Whether an alpha/2 pulse prepares the train.
preparation (float, optional) – Time in milliseconds from the start of the alpha/2 pulse to the start of the train’s first pulse, half the repetition time when not given. Zero is an instantaneous alpha/2 rotation at the start of the train.
inversion ({None, "ideal", "adiabatic"}, optional) – What comes before the preparation: nothing, an instantaneous inversion scaled by
inv_efficiency, or a hyperbolic secant played sample by sample.inversion_duration (float, optional) – Duration of the adiabatic inversion in milliseconds.
inversion_phase (float, optional) – Phase of the adiabatic inversion in degrees, relative to the train’s first pulse, which decides where the transverse magnetization the inversion leaves points.
spoiler (float, optional) – Time in milliseconds between the inversion and the preparation, at the end of which the transverse magnetization is spoiled.
dwell (float, optional) – How long each sample of a pulse is held, in milliseconds.
- Raises:
ValueError – If the sample falls inside the pulse or after the next one, if the preparation is shorter than its pulse, if
flipis neither scalar nor one per shot, or if a pulse is not a whole number of samples.