tools.igrog#
- bartorch.tools.igrog()#
Non-Cartesian samples moved to their nearest grid point by closed-form GRAPPA (iGROG).
Each sample on the grid’s extent is moved to its nearest Cartesian point by a kernel over
sourcessamples of its readout and every coil. iGROG (Abraham et al. [1]) learns that kernel from the source offsets; here it is the Wiener (linear minimum mean square error) interpolator under the coil cross-correlation of the calibration k-space,\[W = R_{ts} (R_{ss} + \lambda \bar r I)^{-1}, \qquad Q_{cc'}(\delta) = \sum_r m_c(r) \overline{m_{c'}(r)} e^{-2\pi i \delta \cdot r / n},\]with \(R_{ss}\) and \(R_{ts}\) the correlation \(Q\) between the sources and from them to the target, \(m_c\) the calibration’s coil images and \(\bar r\) the mean signal power. \(Q\) is tabulated once on a fine grid of displacements and interpolated, so there is no fit and no seed. The gridded samples can then be encoded by
bartorch.linop.CartesianSense()withpositions=, whose normal is FFTs on the image grid: no NUFFT and no oversampled grid.- Parameters:
kspace (torch.Tensor) –
(coils, *shots, samples)samples.traj (torch.Tensor) –
(*shots, samples, ndim)in grid units,kx, ky[, kz], as forbartorch.linop.NUFFT.shape (tuple) – The image grid,
([z,] y, x).calib (torch.Tensor or sequence of torch.Tensor) – Cartesian calibration k-space
(coils, [z,] y, x)centred atn // 2, on the grid’s k-space spacing; a sequence of them withgroupwhen the contrast changes over the scan.group (torch.Tensor, default=None) –
(*shots,)index intocalibof each shot’s calibration.sources (int, default=3) – Readout samples per kernel.
lam (float, default=1e-3) – Tikhonov weight relative to the mean signal power.
spacing (float, default=1.0) – Arc length between sources along the readout, in grid units;
Nonetakes consecutive samples.reach (int, default=4) – Displacements the correlation is tabulated to, in cells.
upsample (int, default=8) – Table steps per cell.
batch (int, default=1048576) – Targets per pass on a card: what it holds besides the samples.
device (torch.device, default=None) – Where the kernels are solved; the result is on the host.
Noneuses the samples’ device. Each target’s kernel is solved in single precision by a compiled loop: one target per thread on a card, the targets spread over the cores on the host. The card holds the samples andbatchtargets’ indices and results, nothing else.double (bool, default=False) – Solve the kernels in double precision, by torch (slow, for checks).
also (sequence of torch.Tensor, default=()) – More samples shaped as
kspace, such as a draw of pure noise, moved by the same kernels without solving them again.
- Returns:
With
values(coils, M)complex64, their flat gridindex(M,), theshot(flat index of*shots) andsampleeach came from,noise(M,)(each value’s noise variance per coil for unit white noise on the samples) andweights(), the weights of unit mean square that whiten the values;alsoholds the values of the extra samples, in their order.- Return type:
gridded
References
Examples
>>> g = igrog(kspace, traj, (256, 256, 256), calib) >>> values = g.values * g.weights()