DiffusionSimulator#
- class blochsim.simulators.DiffusionSimulator[source]#
Bases:
SimulatorDiffusion-weighted signal attenuation by Gaussian diffusion, in closed form.
The signal is
M0 exp(-b D)for an isotropicD[1]. Withdirectionsit isM0 exp(-b g^T D g)for unit gradient directionsg, and the six entries ofTENSORare the properties in place ofD. Relaxation is not modelled: the signal is relative to theb = 0valueM0, and real.- Parameters:
b (float or array-like) – b-values, in s/mm^2.
directions (array-like, default=None) – Unit gradient directions of shape
(len(b), 3), one per b-value; selects the tensor model.
- Tissue properties:
D (float or array-like) – Apparent diffusion coefficient, in um^2/ms; read when
directionsis not given.Dxx, Dyy, Dzz, Dxy, Dxz, Dyz (float or array-like, default=0.0) – Entries of the diffusion tensor, in um^2/ms; read when
directionsis given.M0 (float or array-like, default=1.0) – Signal at
b = 0.
References
Examples
from blochsim.simulators import DiffusionSimulator sequence = DiffusionSimulator(b=(0.0, 500.0, 1000.0, 2000.0)) signal = sequence.simulate(D=(0.8, 3.0)) print(signal.shape)
torch.Size([2, 4])
Methods
bindReturn a copy with further arguments fixed.
describeReturn the
SequenceDescriptionof a protocol.Return the closed-form signal.
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.
layoutReturn the operators of one repetition in playing order.
playedReturn the protocol arguments of
layout(), arrays as torch tensors.repetition_sReturn the duration of one repetition in seconds.
simulateReturn the recorded signal.