DiffusionSimulator#

class blochsim.simulators.DiffusionSimulator[source]#

Bases: Simulator

Diffusion-weighted signal attenuation by Gaussian diffusion, in closed form.

The signal is M0 exp(-b D) for an isotropic D [1]. With directions it is M0 exp(-b g^T D g) for unit gradient directions g, and the six entries of TENSOR are the properties in place of D. Relaxation is not modelled: the signal is relative to the b = 0 value M0, 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 directions is 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 directions is 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

bind

Return a copy with further arguments fixed.

describe

Return the SequenceDescription of a protocol.

evaluate

Return the closed-form signal.

from_description

Return a simulator that plays an existing description.

from_pulseq

Return a simulator over one repetition of a Pulseq sequence.

jacobian

Return the signal and its derivative with respect to tissue properties.

layout

Return the operators of one repetition in playing order.

played

Return the protocol arguments of layout(), arrays as torch tensors.

repetition_s

Return the duration of one repetition in seconds.

simulate

Return the recorded signal.

evaluate()[source]#

Return the closed-form signal.