fmSSFPSimulator

fmSSFPSimulator#

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

Bases: Simulator

A balanced SSFP train whose RF frequency is swept through one passband per sweep.

The n-th pulse of a sweep, counted from zero, is played pi + 2 pi n / nshots radians ahead of the pulse before it. A phase increment acts on the magnetization as an off-resonance of increment / (2 pi TR), so across one sweep of nshots repetitions every voxel is carried once through the period 1 / TR of the balanced SSFP off-resonance profile [1]. Each sample is demodulated by the phase of its own pulse, and sweeps sweeps are played before the one recorded, which is how the radial acquisition of [2] is prepared. The pulses are instantaneous rotations unless pulse_duration is given, and are then the windowed sincs TrueFISPSimulator plays. This is the sequence BART’s epg plays as fmSSFP.

References

Examples

from torchsim.simulators import fmSSFPSimulator

sequence = fmSSFPSimulator(flip=30.0, TR=5.0, nshots=100)
signal = sequence.simulate(T1=1000.0, T2=100.0, B0=20.0)
print(signal.shape)
torch.Size([100])

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 sweeps, one sample per shot of the last.

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, TR, nshots, sweeps=1, TE=None, pulse_duration=0.0, bandwidth_time=4.0, dwell=0.01)[source]#

Return the sweeps, one sample per shot of the last.

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

  • TR (float) – Repetition time in milliseconds, pulse centre to pulse centre.

  • nshots (int) – Excitations in one sweep.

  • sweeps (int, optional) – Sweeps played before the one recorded.

  • TE (float, optional) – Echo time in milliseconds, from the centre of the pulse; half the repetition time when not given, where a balanced train refocuses.

  • pulse_duration (float, optional) – Duration of each pulse in milliseconds. Zero plays each as an instantaneous rotation.

  • bandwidth_time (float, optional) – Zero crossings of the Hamming-windowed sinc across a pulse.

  • dwell (float, optional) – How long each sample of a pulse is held, in milliseconds.

Raises:

ValueError – If the sample falls inside the pulse or after the next one, if sweeps is negative, if flip is neither scalar nor one per shot, or if a pulse is not a whole number of samples.