make_complementary_order#
- pypulseqpp.make_complementary_order()[source]#
Echo-train ordering of Cartesian views with complementary Poisson-disc echoes.
Each echo index is a frame of a time-resolved reconstruction. Every view is assigned to one echo so that each echo’s views form a variable-density Poisson-disc pattern of their own, and echoes within
temporal_widthof each other complement one another: no two views closer than one echo’s local spacing share an echo or neighbouring echoes. This is the complementary Poisson-disc split of Levine et al. [1] applied to a fixed support: the union of the echoes iscoords, so the static sampling is unchanged, and the aliasing of each echo and of a temporal subspace is pushed away from the point-spread function’s main lobe, where random echo positions (make_shuffling_order()) leave it.Every echo holds
ceil(N / train_length)views, one per shot, except that the last echoes hold one fewer whenNis not a multiple oftrain_length. Within each echo, views are dealt to shots in raster order (kz, thenky), so a shot spans a band of k-space.- Parameters:
coords (array_like) – Centred integer coordinates of the selected views: an
(N, 2)array of(ky, kz)or an(N,)array ofky. Encoded view indices(y, z)on an(n_y, n_z)grid convert asviews - (n_y // 2, n_z // 2). Views must not repeat.train_length (int) – Echo-train length, at least 1: the number of frames.
seed (int, default=0) – Seed of the random draw. Equal seeds give equal orders.
temporal_width (float or None, default=None) – Half-width, in echoes, of the exclusion between neighbouring echoes.
0makes every echo a Poisson-disc pattern on its own with no coupling between echoes.Noneistrain_length / 8.pad (bool, default=False) – Pad every train to
train_lengthwithNone, so that the position in a train is the echo index. WithFalsetheNoneentries are removed.
- Returns:
trains –
trains[s][e]is the row index intocoordsof the view acquired at echoeof shots; every row appears exactly once. Withpad=True,Nonemarks an echo that acquires no view. Emptycoordsgive[].- Return type:
- Raises:
TypeError – If
coordsis a boolean mask or not numeric.ValueError – If
coordsis not integral, repeats a view or has the wrong shape,train_lengthis not a positive integer, ortemporal_widthis negative.
See also
make_shuffling_orderrandom echo positions within raster-contiguous trains.
make_cartesian_plane_samplingthe Poisson-disc support itself (
sampling='poisson').
References
Examples
>>> import numpy as np >>> import pypulseqpp as pp >>> mask = pp.make_poisson_disc_mask((32, 32), 4.0, calib=(8, 8), seed=0) >>> views = np.argwhere(mask) - (16, 16) >>> trains = pp.make_complementary_order(views, 8, seed=0, pad=True) >>> len(trains) == -(-len(views) // 8), {len(train) for train in trains} (True, {8}) >>> sorted(i for train in trains for i in train if i is not None) == list(range(len(views))) True