make_crusher

Contents

make_crusher#

pypulseqpp.make_crusher()[source]#

Create a crusher winding dephasing_cycles of phase across a voxel.

The area dephasing_cycles / voxel_size (1/m) goes to make_extended_trapezoid_area(), whose return this keeps. Non-zero grad_start or grad_end joins the crusher to a gradient already playing, such as the slice-select lobe around a refocusing pulse.

Parameters:
  • dephasing_cycles (float) – Cycles of phase to accrue across voxel_size.

  • voxel_size (float) – Length over which the dephasing is counted (m).

  • channel (str) – Gradient channel ("x", "y" or "z").

  • grad_start (float, default=0.0) – Amplitudes to begin and end at (Hz/m).

  • grad_end (float, default=0.0) – Amplitudes to begin and end at (Hz/m).

  • convert_to_arbitrary (bool, default=False) – Return the gradient as an arbitrary waveform.

  • system (pypulseqpp.Opts, default=None) – System limits.

Returns:

  • grad (GradEvent)

  • times (numpy.ndarray) – Vertex times (s).

  • amplitudes (numpy.ndarray) – Vertex amplitudes (Hz/m).

Raises:

ValueError – If voxel_size or dephasing_cycles is not positive.

Examples

>>> import pypulseqpp as pp
>>> system = pp.Opts(max_grad=30, grad_unit="mT/m", max_slew=150, slew_unit="T/m/s")
>>> crusher, times, amplitudes = pp.make_crusher(4.0, 5e-3, "z", system=system)
>>> round(float(amplitudes[0])), round(float(amplitudes[-1]))
(0, 0)

Four cycles across a 5 mm voxel is an area of 800 per metre:

>>> import numpy as np
>>> round(float(np.trapezoid(amplitudes, times)), 6)
800.0

See also

make_hexagon_gradient_area

the same area without holding a plateau.