SpinEchoSimulator

SpinEchoSimulator#

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

Bases: Simulator

A spin echo repeated every TR, optionally behind an inversion.

The refocusing pulse at TE / 2 inverts what has recovered since the excitation, so the longitudinal magnetization the next excitation finds is 1 - 2 exp(-(TR - TE / 2) / T1) + exp(-TR / T1) of equilibrium [1], and the echo decays with T2. An inversion time multiplies this by the recovery from the inversion, 1 - (1 + inv_efficiency) exp(-TI / T1).

References

Examples

from torchsim.simulators import SpinEchoSimulator

sequence = SpinEchoSimulator(TE=(10.0, 30.0, 60.0, 100.0), TR=2000.0)
signal = sequence.simulate(T1=1000.0, T2=(50.0, 100.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.