deepmr.shepp_logan

Contents

deepmr.shepp_logan#

deepmr.shepp_logan(npix, nslices=1, qmr=False, B0=3.0)[source]#

Initialize numerical phantom for MR simulations.

This function generates a numerical phantom for qMR or MR simulations based on the provided parameters.

Parameters:
  • npix (Iterable[int]) – In-plane matrix size.

  • nslices (int, optional) – Number of slices. An isotropic [npix, npix, npix] phantom can be generated, for convenience, by setting nslices to -1. The default is 1.

  • qmr (bool, optional) – Flag indicating whether the phantom is for qMRI (True) or MR (False) simulations. The default is False.

  • B0 (float, optional) – Static field strength in [T]. Ignored if mr is False. The default is 3.0.

Returns:

phantom – Shepp-Logan phantom of shape (nslices, ny, nx) (qmr == False) or a dictionary of maps (M0, T1, T2, T2star, chi) of shape (nslices, ny, nx) (qmr == True). Units for T1, T2 and T2star are [ms]; for chi, units are [ppm].

Return type:

torch.Tensor, dict

Examples

>>> import deepmr

We can generate a non-quantitative Shepp-Logan phantom as:

>>> phantom = deepmr.shepp_logan(128)
>>> phantom.shape
torch.Size([128, 128])

We also support multiple slices:

>>> phantom = deepmr.shepp_logan(128, 32)
>>> phantom.shape
torch.Size([32, 128, 128])

An isotropic [npix, npix, npix] phantom can be generated by setting nslices to -1:

>>> phantom = deepmr.shepp_logan(128, -1)
>>> phantom.shape
torch.Size([128, 128, 128])

We can also generate quantitative M0, T1, T2, T2* and magnetic susceptibility maps:

>>> phantom = deepmr.shepp_logan(128, qmr=True)
>>> phantom.keys()
dict_keys(['M0', 'T1', 'T2', 'T2star', 'chi'])

Each map will have (nslices, npix, npix) shape:

>>> phantom["M0"].shape
torch.Size([128, 128])

References

[1] L. A. Shepp and B. F. Logan, “The Fourier reconstruction of a head section,” in IEEE Transactions on Nuclear Science, vol. 21, no. 3, pp. 21-43, June 1974, doi: 10.1109/TNS.1974.6499235.