calc_rf_shim

Contents

calc_rf_shim#

pypulseqpp.calc_rf_shim()[source]#

Return per-channel weights whose combined B1 field has magnitude target.

Magnitude least squares over mask: the combined field sum_c w[c] * b1_maps[c] has free phase. The fit starts from the channel combination that delivers the most field over the mask.

Parameters:
  • b1_maps (array_like) – Complex B1+ per channel, (num_channels, *grid), in any unit shared by all channels.

  • mask (array_like of bool, default=None) – Where the magnitude is fitted, shaped like the grid. Defaults to every point where any map is non-zero.

  • target (float or array_like, default=1.0) – Magnitude wanted, in the unit of b1_maps: a scalar or one value per grid point.

  • regularization (float, default=0.0) – Tikhonov weight on sum |w|^2.

  • tolerance (float, default=1e-06) – Relative change of the cost at which the fit stops.

  • rounds (int, default=100) – Maximum number of phase exchanges.

Returns:

(num_channels,) complex weights, as make_rf_shim() takes them.

Return type:

numpy.ndarray

Raises:

ValueError – If mask or target does not match the grid, or the mask is empty.