check

Contents

check#

pulserver.ir.check()[source]#

Return the problems of a chain under a scanner’s limits, in the physical frame.

Each file of the NextSequence chain is rotated by rotation, composed after each block’s own rotation with blocks labelled NOROT exempt, as the scanner plays it. It is then checked with pypulseqpp.check_timing, gradient continuity included, and with pypulseqpp.safety.check_max_grad and check_max_slew, against the gradient limits, dead times and ringdown time of system; the RF peaks against its max_b1 where it has one, and each arbitrary gradient’s length against limits.wave_memory; and with check_pns, check_mech_resonance and check_spl where limits carries a nerve model, forbidden bands or an acoustic transfer function; under limits.follows_poses, a chain a file of which sets EnablePmc also has its gradient amplitude and slew rate summed over the axes held to the per-axis limits, which is what every rotation the poses may bring keeps within them; the gradient spectrum is read over windows of RESONANCE_WINDOW, a band stating no amplitude is held to RESONANCE_FLOOR, and a stated amplitude limits the axis’s gradient while the band holds a line. The waveforms are timed by the file’s own rasters. VOPs are not checked here: see sar_ratios().

Parameters:
  • seq_path (Path | str) – The first file of the chain.

  • system (pypulseqpp.Opts) – The scanner’s gradient limits, dead times and ringdown time.

  • rotation (np.ndarray, default=None) – (3, 3) prescription rotation from logical to physical axes, a reflection included; the identity by default.

  • limits (CheckLimits, default=None) – The nerve and resonance limits; none by default.

  • designed (list[tuple[Path, pypulseqpp.Sequence]], default=None) – (path, sequence) pairs of the chain as mrd._sequence.designed_chain returns them, checked in place of reading the files and rotated in place.

  • spl_levels (Sequence[SplLevels], default=None) – One per file of the chain, as spl_levels() returns them for rotation, held to the limits in place of computing them.

  • readings (dict, default=None) – Filled, where given, with the largest reading over the chain of the gradient checks, each as a fraction of its limit: "grad" and "slew", the gradient amplitude and slew rate on a physical axis; "vector_grad" and "vector_slew", the same summed over the axes, under limits.follows_poses for a chain that sets EnablePmc; and "pns", the nerve response over limits.pns_limit, where a nerve model is given.

Returns:

One line per problem, naming the file when the chain has more than one; empty when every check passes.

Return type:

list of str

Raises:

ValueError – If a file of the chain or the acoustic file cannot be read, or rotation is not orthonormal.