make_radial_adaptive_order

make_radial_adaptive_order#

pypulseqpp.make_radial_adaptive_order()[source]#

Echo-train ordering of Cartesian views in radial order about a target echo.

The views are ranked by their distance from the origin (the k-space centre) and cut into train_length radius bands of ceil(N / train_length) views. The innermost band is acquired at center_echo and successive bands at the echoes increasingly distant from it, alternating before and after, so the distance from the centre increases monotonically away from the target echo in both directions. Within a band the views are dealt across the shots in polar-angle order. This is scheme C (modified radial reordering) of Buonincontri et al., Fig. 2C-D, which acquires the k-space centre at a prescribed echo without a discontinuity at the centre.

Parameters:
  • coords (array_like) – Centred coordinates of the selected views: an (N, 2) array of (ky, kz) or an (N,) array of ky, relative to the k-space centre, which is the origin. Encoded view indices (y, z) on an (n_y, n_z) grid convert as views - (n_y // 2, n_z // 2). Distances and angles are evaluated in the units supplied. Boolean masks are not accepted.

  • train_length (int) – Echo-train length, at least 1. The number of shots is ceil(N / train_length).

  • center_echo (int or None, default=None) – Echo at which the innermost band, and so the view nearest the origin, is acquired, in [0, train_length). None is echo 0.

  • pad (bool, default=False) – Pad every train to train_length with None, so that the position in a train is the echo index. With False the None entries are removed.

Returns:

trains – trains[s][e] is the row index into coords of the view acquired at echo e of shot s. The values are indices, not coordinates; every row of coords appears exactly once. With pad=True, None marks an echo that acquires no view. Empty coords give [].

Return type:

list of list of int

Raises:
  • TypeError – If coords is a boolean mask or not numeric.

  • ValueError – If coords does not have shape (N,) or (N, 2), train_length is not a positive integer, or center_echo is outside [0, train_length).

See also

make_radial_order

centre-out order within angular wedges.

make_centric_order

distance order rotated rather than folded.

Examples

Nine centred ky views in three shots of three echoes, with the centre view acquired at echo 1:

>>> import numpy as np
>>> import pypulseqpp as pp
>>> views = np.arange(-4, 5)
>>> trains = pp.make_radial_adaptive_order(views, 3, center_echo=1)
>>> trains
[[6, 4, 8], [7, 5, 1], [2, 3, 0]]
>>> views[np.array(trains)]
array([[ 2,  0,  4],
       [ 3,  1, -3],
       [-2, -1, -4]])

The distance from the centre is smallest at echo 1 in every shot:

>>> np.abs(views[np.array(trains)]).argmin(axis=1).tolist()
[1, 1, 1]