read_vops

Contents

read_vops#

pypulseqpp.safety.read_vops()[source]#

Read VOPs and a global SAR matrix from a .mat or .npz file.

A .mat file holds MATLAB’s (Nc, Nc, N) stack, named VOP, vops, Q10g or Q, and optionally Sglobal or global_matrix; the stack is read into (N, Nc, Nc). MATLAB v7.3 (HDF5) files are not read. An .npz file holds vops as (N, Nc, Nc) and optionally global_matrix.

Parameters:

path (str | os.PathLike) – The .mat or .npz file to read.

Returns:

The VOPs and, where the file carries one, the global SAR matrix, for check_sar() to take as its model.

Return type:

VopModel

Raises:
  • ValueError – If the file holds no recognised VOP array, or one whose shape is not a square stack.

  • OSError – If the file cannot be read, a MATLAB v7.3 file among them.