plot_rf

Contents

plot_rf#

pypulseqpp.plot.plot_rf()[source]#

Draw an RF pulse’s |B1| envelope beside the profile it produces.

Parameters:
  • source (Sequence, sequence module or RF event) – Source of the pulse. For a sequence, only the pulse’s own block is simulated unless a range is given; a module is simulated in full.

  • pulse (RF event or str, default=None) – Which pulse of source: an event, or the use it is tagged with ("refocusing" finds a spin echo’s refocusing pulse). The first pulse by default.

  • time_range (sequence, default=None) – Range to simulate over, for a sequence source: two times (s), or the first and last block (1-based, inclusive). At most one.

  • block_range (sequence, default=None) – Range to simulate over, for a sequence source: two times (s), or the first and last block (1-based, inclusive). At most one.

  • plane (str, default=None) – One of x, y, z and f (off-resonance) for a profile, or two for a plane drawn as |Mxy| and Mz heatmaps. When None, the axis the pulse is selective along, or f without a gradient.

  • kind (str, default=None) – Response a profile draws: 'refocusing' draws refocusing efficiency, 'inversion', 'saturation' and 'preparation' draw Mz, and any other value |Mxy|. The pulse’s use when None.

  • extent (float or pair of float, default=None) – Limits of the first and second axis of plane: a half-width about zero or a (low, high) pair, in mm for a position and Hz for off-resonance. Derived from the pulse when None.

  • span (float or pair of float, default=None) – Limits of the first and second axis of plane: a half-width about zero or a (low, high) pair, in mm for a position and Hz for off-resonance. Derived from the pulse when None.

  • samples (int, default=401) – Points per axis; a plane caps at 91 a side.

  • dt (float, default=8e-06) – Integration step (s) where the window is integrated rather than the pulse alone.

  • whole (bool, default=False) – Integrate everything in the window – every pulse, gradient and the precession between them – rather than the pulse alone. A plane is always integrated this way.

  • title (str, default=None) – Figure title.

  • plot_now (bool, default=True) – Show the figure before returning.

Returns:

The envelope panel (|B1| in microtesla against time in ms) and the profile, or the two heatmaps for a plane.

Return type:

matplotlib.figure.Figure

Raises:
  • ValueError – If source or the range given holds no RF event, plane is not one or two of x, y, z, f, or a single position axis is not the pulse’s selection axis and whole is False.

  • TypeError – If source is not a Sequence, a sequence module or an RF event.

Notes

A single pulse against one axis is pypulseqpp.sim_rf(), which ignores the gradient: a position axis is its frequency axis over the selection gradient at the pulse centre. Everything else integrates pypulseqpp.sim_bloch() over the window without relaxation.