FLASHSimulator#
- class blochsim.simulators.FLASHSimulator[source]#
Bases:
SimulatorSpoiled gradient-echo (FLASH, SPGR) train from equilibrium, optionally inverted first.
Each excitation is a windowed sinc played sample by sample, or an instantaneous rotation when
pulse_durationis zero. Transverse magnetization is spoiled ideally, or by RF spoiling with a gradient winding one configuration order per repetition [2]; withinversionthe train is the inversion-recovery FLASH of Look-Locker T1 mapping [1]. The signal is one complex sample per shot, atTEafter the pulse centre.- Parameters:
flip (float or array-like) – Flip angle, in degrees; scalar or one per shot.
TR (float) – Repetition time, in ms, pulse centre to pulse centre.
TE (float) – Echo time, in ms, from the pulse centre; at least half the pulse and ending before the next pulse.
nshots (int) – Excitations in the train.
pulse_duration (float, default=1.0) – Excitation duration, in ms; zero is an instantaneous rotation. A whole number of
dwell.bandwidth_time (float, default=4.0) – Zero crossings of the Hamming-windowed sinc across the pulse.
inversion ({None, "ideal", "adiabatic"}, default=None) – Preparation: none, an instantaneous inversion scaled by
inv_efficiency, or a sampled hyperbolic secant.inversion_duration (float, default=10.0) – Duration of the adiabatic inversion, in ms.
inversion_phase (float, default=0.0) – Phase of the adiabatic inversion relative to the first pulse, in degrees.
spoiler (float, default=0.0) – Time between the inversion and the train, ending in a spoiler, in ms.
dwell (float, default=0.01) – Hold time of each pulse sample, in ms.
rf_spoiling (float, default=None) – RF-spoiling phase increment, in degrees: excitation
n, from zero, has phaserf_spoiling * n * (n + 1) / 2. Ideal spoiling when not given.states (int, default=None) – Configuration states kept. When not given, one under ideal spoiling and up to one per repetition, to the engine’s limit, under RF spoiling.
- Tissue properties:
T1, T2 (float or array-like) – Relaxation times, in ms.
M0 (float or array-like, default=1.0) – Equilibrium magnetization.
B1 (float or array-like, default=1.0) – Transmit field, as a fraction of the nominal flip angle.
B0 (float or array-like, default=0.0) – Off-resonance, in Hz.
inv_efficiency (float or array-like, default=1.0) – Fraction of a perfect inversion; scales the ideal inversion.
Notes
Corresponds to the sequences BART’s
simplays asFLASHandIR-FLASH, and with instantaneous pulses and the sample at the pulse to the one itsepgplays as FLASH.References
Examples
from blochsim.simulators import FLASHSimulator sequence = FLASHSimulator( flip=8.0, TR=5.0, TE=2.0, nshots=100, inversion="adiabatic" ) signal = sequence.simulate(T1=1000.0, T2=100.0) print(signal.shape)
torch.Size([100])
Methods
bindReturn a copy with further arguments fixed.
describeReturn the
SequenceDescriptionof a protocol.Simulate the train, on one configuration order unless it winds.
from_descriptionReturn a simulator that plays an existing description.
from_pulseqReturn a simulator over one repetition of a Pulseq sequence.
jacobianReturn the signal and its derivative with respect to tissue properties.
Return the train, one sample per shot.
playedReturn the protocol arguments of
layout(), arrays as torch tensors.repetition_sReturn the duration of one repetition in seconds.
simulateReturn the recorded signal.
- layout()[source]#
Return the train, one sample per shot.
- Raises:
ValueError – If the sample falls inside the pulse or after the next one, if
flipis neither scalar nor one per shot, or if a pulse is not a whole number of samples.