MultiGradientEchoSimulator#

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

Bases: Simulator

Water and fat, dephasing and decaying across a gradient-echo train.

Fat is a multi-peak spectrum [1] at a fixed set of chemical shifts, so its signal at each echo is a known complex modulation and what is left to fit per voxel is how much fat there is, the transverse decay and the off-resonance. Each model BART’s multi-echo fits use is a subset of the properties: water and fat with a shared or separate T2*, water alone with T2*, and off-resonance alone.

fat_fraction and fat_phase span the water and fat signals: with a complex scale in front, water is (1 - fat_fraction) of it and fat fat_fraction of it rotated by fat_phase. Leaving T2star out means no decay, and leaving fat_T2star out gives fat water’s T2*.

References

Examples

from torchsim.simulators import MultiGradientEchoSimulator

sequence = MultiGradientEchoSimulator(TE=(1.2, 2.4, 3.6, 4.8, 6.0, 7.2))
signal = sequence.simulate(fat_fraction=(0.0, 0.2), T2star=30.0, B0=15.0)
print(signal.shape)
torch.Size([2, 6])

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.