HSFPSimulator

HSFPSimulator#

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

Bases: Simulator

A balanced train whose flip angle varies slowly, in the hybrid state.

With the flip angle varied slowly enough, the magnetization stays on the spin-locked axis the train defines and only its length evolves, relaxing at sin^2(a) / T2 + cos^2(a) / T1 and driven by cos(a) / T1 [1]. The train is played repeatedly and the recorded pass starts from where the previous one ended, times beta: -1 for an inversion between passes, which is what makes the answer sensitive to T1 and T2 at once, and 1 for none.

The signal is the magnetization along the spin-locked axis at each pulse, which for a balanced train is the transverse magnetization at the echo.

References

Examples

import torch
from torchsim.simulators import HSFPSimulator

train = 60.0 * torch.sin(torch.linspace(0.0, torch.pi, 400)) ** 2
sequence = HSFPSimulator(flip=train, TR=4.5)
signal = sequence.simulate(T1=1000.0, T2=(50.0, 100.0))
print(signal.shape)
torch.Size([2, 400])

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.