deepmr.b1field

Contents

deepmr.b1field#

deepmr.b1field(shape, nmodes=1, b1range=(0.5, 2.0), shift=None, dphi=0.0, coil_width=1.1, ncoils=8, nrings=None, mask=None)[source]#

Simulate inhomogeneous B1+ fields.

Adapted from SigPy [1].

Parameters:
  • shape (Iterable[int]) – Size of the matrix (ny, nx) (2D) or (nz, ny, nx) (3D) for the B1+ field.

  • nmodes (int, optional) – Number of B1+ modes. First mode is CP mode, second is gradient mode, and so on. The default is 1.

  • b1range (Iterable[float]) – Range of B1+ magnitude. The default is (0.5, 2.0).

  • shift (Iterable[int], optional) – Displacement of the coil center with respect to matrix center. The default is (0, 0) / (0, 0, 0).

  • dphi (float) – Bulk coil angle in [deg]. The default is 0.0°.

  • coil_width (float, optional) – Width of the coil, with respect to image dimension. The default is 1.1.

  • ncoils (int, optional) – Number of transmit coil elements. Standard coils have 2 channels operating in quadrature. To support multiple modes (i.e., PTX), increase this number. The default is 8.

  • nrings (int, optional) – Number of rings for a cylindrical hardware set-up. The default is ncoils // 4.

  • mask (np.ndarray | torch.Tensor, optional) – Region of support of the object of shape (ny, nx) (2D) or (nz, ny, nx) (3D). The default is None.

Returns:

smap – Complex spatially varying b1+ maps of shape (nmodes, ny, nx) (2D) or (nmodes, nz, ny, nx) (3D). Magnitude of the map represents the relative flip angle scaling (wrt to the nominal).

Return type:

torch.Tensor

Example

>>> import deepmr

We can generate a 2D B1+ field map of shape (ny=128, nx=128) by:

>>> b1map = deepmr.b1field((128, 128))

Field center and rotation can be modified by shift and dphi arguments:

>>> b1map = deepmr.b1field((8, 128, 128), shift=(-3, 5), dphi=30.0) # center shifted by (dy, dx) = (-3, 5) pixels and rotated by 30.0 degrees.

B1+ values range and steepness of variation can be specified using b1range and coil_width arguments:

>>> # transmit coil is 4 times bigger than FOV (e.g., body coil) and
>>> # B1+ scalings are between (0.8, 1.2) the nominal flip angle (e.g., 3T scanner)
>>> b1map3T = deepmr.b1field((128, 128), b1range=(0.8, 1.2), coil_width=4.0)
>>>
>>> # transmit coil is 1.1 times bigger than FOV (e.g., head coil) and
>>> # B1+ scalings are between (0.5, 2.0) the nominal flip angle (e.g., 7T scanner)
>>> b1map7T = deepmr.b1field((128, 128), b1range=(0.5, 2.0), coil_width=1.1)

Multiple orthogonal modes can be simulated by nmodes argument. For example, CP mode and gradient mode can be obtained as:

>>> b1map = deepmr.b1field((128, 128), nmodes=2) # b1map[0] is CP, b1map[1] is gradient mode.

Three dimensional B1+ maps of shape (nz, ny, nx) can be obtained as:

>>> b1map = deepmr.b1field((128, 128, 128))

Beware that this will require more memory.

References

[1] mikgroup/sigpy