LorentzianSimulator#
- class torchsim.simulators.LorentzianSimulator(*args, **kwargs)[source]#
Bases:
SimulatorA Z-spectrum as equilibrium minus one Lorentzian line per pool.
Each pool saturates the water signal along a Lorentzian line centred on its own offset [1], and the lines add:
M0 (1 - sum_i A_i (W_i / 2)^2 / ((W_i / 2)^2 + (offset - shift_i)^2))Pool
i, counted from one, exposespool{i}_amplitude,pool{i}_width(the full width at half maximum) andpool{i}_shift.- Parameters:
pools (int) – How many Lorentzian lines.
**values – Properties or sequence arguments to fix, as for any simulator.
References
Examples
import torch from torchsim.simulators import LorentzianSimulator sequence = LorentzianSimulator(2, offsets=torch.linspace(-5.0, 5.0, 41)) signal = sequence.simulate( pool1_amplitude=0.9, pool1_width=1.5, pool1_shift=0.0, pool2_amplitude=0.1, pool2_width=2.0, pool2_shift=3.5, ) print(signal.shape)
torch.Size([41])
Methods
bindThis simulator with more fixed on it, values or settings alike.
describeReturn the description this protocol plays.
Evaluate the closed form, no state machine and no description.
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.layoutReturn the operators of one repetition, in the order they play.
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.