HyperechoSimulator#

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

Bases: FSESimulator

A refocused train mirrored about a central refocusing pulse.

The pulses after the central one replay those before it in reverse order, each with the opposite flip angle about the opposite phase – -alpha about -phi, which is alpha at 180 - phi degrees – so every coherence pathway the first half split is brought back by the last echo, the hyperecho [1]. But for relaxation, that echo is the full spin echo of the excitation, whatever the flip angles before it. Every echo is demodulated at zero phase, the axis of the central pulse. With one flip angle at zero phase throughout, this is the sequence BART’s epg plays as Hyperecho.

References

Examples

import torch
from torchsim.simulators import HyperechoSimulator

sequence = HyperechoSimulator(flip=60.0 * torch.ones(5), ESP=10.0)
signal = sequence.simulate(T1=1000.0, T2=80.0)
print(signal.shape)
torch.Size([11])

Methods

bind

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

describe

Return the description this protocol plays.

evaluate

Simulate one train, then let it recover for what is left of the TR.

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 train, placed at the echo times it is timed from.

played

Return the protocol as it will be laid out.

repetition_s

Return the TR, which the train waits out before the next one.

simulate

Return the recorded signal.

states = None#
layout(*, flip, ESP, phases=0.0, refocusing=180.0, exc_flip=90.0, exc_phase=90.0, TR=1e6)[source]#

Return the train, placed at the echo times it is timed from.

Parameters:
  • flip (float or array-like) – Flip angles in degrees of the refocusing pulses before the central one, one per echo; the train holds twice as many and one more.

  • ESP (float or array-like) – Echo spacing in milliseconds.

  • phases (float or array-like, optional) – Phases in degrees of the refocusing pulses before the central one.

  • refocusing (float, optional) – Flip angle in degrees of the central pulse, played at zero phase.

  • exc_flip (float, optional) – The excitation, in degrees.

  • exc_phase (float, optional) – The excitation, in degrees.

  • TR (float or array-like, optional) – Repetition time in milliseconds, which sets how far the longitudinal magnetization recovers before the next train.