DiffusionSimulator#

class torchsim.simulators.DiffusionSimulator(*args, **kwargs)[source]#

Bases: Simulator

Attenuation by Gaussian diffusion, at a series of b-values.

The signal is M0 exp(-b D) for an isotropic D [1], or M0 exp(-b g^T D g) for a diffusion tensor along unit gradient directions g, which is what giving directions asks for: the six entries of TENSOR are then the properties, and D is not.

References

Examples

from torchsim.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

This simulator with more fixed on it, values or settings alike.

describe

Return the description this protocol plays.

evaluate

Evaluate the closed form, no state machine and no description.

from_description

Return a simulator over a stream someone else assembled.

from_pulseq

Return a simulator over one repetition of a Pulseq sequence.

jacobian

Return the signal and its derivative with respect to diff.

layout

Return the operators of one repetition, in the order they play.

played

Return the protocol as it will be laid out.

repetition_s

Return how long one repetition lasts, given what the layout played.

simulate

Return the recorded signal.

evaluate(properties, **sequence)[source]#

Evaluate the closed form, no state machine and no description.