MRFSimulator#

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

Bases: Simulator

An inversion, then a variable flip-angle train whose readouts wind on.

Examples

import torch
from torchsim.simulators import MRFSimulator

sequence = MRFSimulator(
    flip=torch.linspace(5.0, 60.0, 1000), TR=10.0, states=20
)
signal = sequence.simulate(T1=1000.0, T2=80.0, inv_efficiency=0.95)

Methods

bind

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

describe

Return the description this protocol plays.

evaluate

Return the last playing of the train, which is the one measured.

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 prepared train, one excitation and one sample per TR.

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, TI=0.0, phases=0.0)[source]#

Return the prepared train, one excitation and one sample per TR.

Parameters:
  • flip (float or array-like) – Excitation flip angles in degrees, one per repetition.

  • TR (float or array-like) – Repetition time in milliseconds, scalar or one per repetition.

  • TI (float or array-like, optional) – Inversion time in milliseconds.

  • phases (float or array-like, optional) – Excitation phases in degrees.

evaluate(properties, **sequence)[source]#

Return the last playing of the train, which is the one measured.