deepmr.b0field#
- deepmr.b0field(chi, b0range=(-200, 200), mask=None)[source]#
Simulate inhomogeneous B0 fields.
Output field units is
[Hz]. The field is created by convolving the dipole kernel with an input magnetic susceptibility map.- Parameters:
chi (np.ndarray | torch.Tensor) – Object magnetic susceptibility map in
[ppb]of shape(ny, nx)(2D) or(nz, ny, nx)(3D).b0range (Iterable[float]) – Range of B0 field in
[Hz]. The default is(-200, 200).mask (np.ndarray | torch.Tensor, optional) – Region of support of the object of shape
(ny, nx)(2D) or(nz, ny, nx)(3D). The default isNone.
- Returns:
B0map – Spatially varying B0 maps of shape
(ny, nx)(2D) or(nz, ny, nx)(3D) in[Hz], arising from the object susceptibility.- Return type:
Example
>>> import deepmr
We can generate a 2D B0 field map of shape
(ny=128, nx=128)starting from a magnetic susceptibility distribution:>>> chi = deepmr.shepp_logan(128, qmr=True)["chi"] >>> b0map = deepmr.b0field(chi)
B0 values range can be specified using
b0rangeargument:>>> b0map = deepmr.b0field(chi, b0range=(-500, 500))