StimulatedEchoSimulator#

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

Bases: Simulator

Three pulses, sampled at the spin echo of the first two and at the stimulated echo.

The second pulse, TE / 2 after the first, refocuses part of the transverse magnetization into a spin echo at TE and stores part of it along z, where it relaxes with T1 alone; the third pulse, TM after the second, returns that part to the transverse plane, where it rephases into the stimulated echo TE / 2 later [1]. With instantaneous pulses about x, the two samples are i M0 sin(a1) sin^2(a2 / 2) exp(-TE / T2) and i M0 sin(a1) sin(a2) sin(a3) exp(-TE / T2) exp(-TM / T1) / 2, whatever the off-resonance. The transverse magnetization is spoiled after the spin echo, so the second sample is the stimulated echo alone. With one flip angle, and TE twice and TM three times its own echo time, this is the sequence BART’s epg plays as Spinecho.

References

Examples

from torchsim.simulators import StimulatedEchoSimulator

sequence = StimulatedEchoSimulator(flip=90.0, TE=20.0, TM=100.0)
spin_echo, stimulated_echo = sequence.simulate(T1=1000.0, T2=80.0)

Methods

bind

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

describe

Return the description this protocol plays.

evaluate

Run one simulation of the described protocol.

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 three pulses and the two samples.

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.

layout(*, flip, TE, TM)[source]#

Return the three pulses and the two samples.

Parameters:
  • flip (float or array-like) – Flip angle in degrees, scalar or one per pulse.

  • TE (float) – Echo time in milliseconds: twice the spacing of the first two pulses, and of the third pulse and the stimulated echo.

  • TM (float) – Mixing time in milliseconds, from the second pulse to the third.

Raises:

ValueError – If the third pulse would play before the spin echo, or if flip is neither scalar nor one per pulse.