deepmr.spiral#
- deepmr.spiral(shape, accel=None, nintl=1, **kwargs)[source]#
Design a constant- or multi-density spiral.
The spiral interleaves are rotated by a pseudo golden angle with period 377 interelaves. Rotations are performed both along
view
andcontrast
dimensions. Acquisition is assumed to traverse thecontrast
dimension first and then theview
, i.e., all the contrasts are acquired before moving to the second view. If multiple echoes are specified, final contrast dimensions will have lengthncontrasts * nechoes
. Echoes are assumed to be acquired sequentially with the same spiral interleaf.- Parameters:
- Keyword Arguments:
moco_shape (int) – Matrix size for inner-most (motion navigation) spiral. The default is
None
.acs_shape (int) – Matrix size for intermediate inner (coil sensitivity estimation) spiral. The default is
None
.acs_nintl (int) – Number of interleaves to fully sample intermediate inner spiral. The default is
1
.variant (str) –
Type of spiral. Allowed values are:
center-out
: starts at the center of k-space and ends at the edge (default).reverse
: starts at the edge of k-space and ends at the center.in-out
: starts at the edge of k-space and ends on the opposite side (two 180° rotated arms back-to-back).
- Returns:
head – Acquisition header corresponding to the generated spiral.
- Return type:
Header
Example
>>> import deepmr
We can create a single-shot spiral for an in-plane matrix of
(128, 128)
pixels by:>>> head = deepmr.spiral(128)
A multi-shot trajectory can be generated by specifying the
nintl
argument:>>> head = deepmr.spiral(128, nintl=48)
Both spirals have constant density. If we want a dual density we can use
acs_shape
andacs_nintl
arguments. For example, if we want an inner(32, 32)
k-space region sampled with a 4 interleaves spiral, this can be obtained as:>>> head = deepmr.spiral(128, nintl=48, acs_shape=32, acs_nintl=4)
This inner region can be used e.g., for Parallel Imaging calibration. Similarly, a triple density spiral can be obtained by using the
moco_shape
argument:>>> head = deepmr.spiral(128, nintl=48, acs_shape=32, acs_nintl=4, moco_shape=8)
The generated spiral will have an innermost
(8, 8)
single-shot k-space region (e.g., for PROPELLER-like motion correction), an intermediate(32, 32)
k-space region fully covered by 4 spiral shots and an outer(128, 128)
region fully covered by 48 interleaves.In-plane acceleration can be specified using the
accel
argument. For example, the following>>> head = deepmr.spiral(128, nintl=48, accel=4)
will generate the following trajectory:
>>> head.traj.shape torch.Size([1, 12, 538, 2])
i.e., a 48-interleaves trajectory with an in-plane acceleration factor of 4 (i.e., 12 interleaves).
Multiple contrasts with different sampling (e.g., for MR Fingerprinting) can be achieved by providing a tuple of ints as the
shape
argument:>>> head = deepmr.spiral((128, 420), nintl=48) >>> head.traj.shape torch.Size([420, 1, 538, 2])
corresponding to 420 different contrasts, each sampled with a different single spiral interleaf of 538 points. Similarly, multiple echoes (with fixed sampling) can be specified as:
>>> head = deepmr.spiral((128, 1, 8), nintl=48) >>> head.traj.shape torch.Size([8, 48, 538, 2])
corresponding to a 8-echoes fully sampled k-spaces, e.g., for QSM and T2* mapping.
Notes
The returned
head
(deepmr.Header()
) is a structure with the following fields:- shape (torch.Tensor):
This is the expected image size of shape
(nz, ny, nx)
.
- t (torch.Tensor):
This is the readout sampling time
(0, t_read)
inms
. with shape(nsamples,)
.
- traj (torch.Tensor):
This is the k-space trajectory normalized as
(-0.5 * shape, 0.5 * shape)
with shape(ncontrasts, nviews, nsamples, 2)
.
- dcf (torch.Tensor):
This is the k-space sampling density compensation factor with shape
(ncontrasts, nviews, nsamples)
.
- TE (torch.Tensor):
This is the Echo Times array. Assumes a k-space raster time of
1 us
and minimal echo spacing.