sensmap#
- mrtwin.sensmap(shape, coil_width=2.0, shift=None, dphi=0.0, nrings=None, cache=None, cache_dir=None)[source]#
Simulate birdcage coils.
Adapted from SigPy [1].
- Parameters:
shape (Iterable[int]) – Size of the matrix
(ncoils, ny, nx)
(2D) or(ncoils, nz, ny, nx)
(3D) for the sensitivity coils.coil_width (float, optional) – Width of the coil, with respect to image dimension. The default is
2.0
.shift (Sequence[int] | None, optional) – Displacement of the coil center with respect to matrix center. The default is
(0, 0)
/(0, 0, 0)
.dphi (float, optional) – Bulk coil angle in
[deg]
. The default is0.0°
.nrings (int | None, optional) – Number of rings for a cylindrical hardware set-up. The default is
ncoils // 4
.cache (bool | None, optional) – If
True
, cache the phantom. The default isTrue
for 3D phantoms andFalse
for single-slice 2D.cache_dir (CacheDirType, optional) – cache_directory for phantom caching. The default is
None
(~/.cache/mrtwin
).
- Returns:
smap – Complex spatially varying sensitivity maps of shape
(nmodes, ny, nx)
(2D) or(nmodes, nz, ny, nx)
(3D). Ifnmodes = 1
, the first dimension is squeezed.- Return type:
torch.Tensor
Example
>>> from mrtwin import sensmap
We can generate a set of
nchannels=8
2D sensitivity maps of shape(ny=128, nx=128)
by:>>> smap = sensmap((8, 128, 128))
Coil center and rotation can be modified by
shift
anddphi
arguments:>>> smap = sensmap((8, 128, 128), shift=(-3, 5), dphi=30.0) # center shifted by (dy, dx) = (-3, 5) pixels and rotated by 30.0 degrees.
Similarly,
nchannels=8
3D sensitivity maps can be generated as:>>> smap = sensmap((8, 128, 128, 128))
Beware that this will require more memory.
References
[1] mikgroup/sigpy