calc_density_compensation_function

calc_density_compensation_function(ktraj, im_size, num_iterations=10, grid_size=None, numpoints=6, n_shift=None, table_oversamp=1024, kbwidth=2.34, order=0.0)[source]

Numerical density compensation estimation.

This function has optional parameters for initializing a NUFFT object. See KbInterp for details.

  • ktraj should be of size (len(grid_size), klength) or (N, len(grid_size), klength), where klength is the length of the k-space trajectory.

Based on the method of Pipe.

This code was contributed by Chaithya G.R.

Parameters
  • ktraj (Tensor) – k-space trajectory (in radians/voxel).

  • im_size (Sequence[int]) – Size of image with length being the number of dimensions.

  • num_iterations (int) – Number of iterations.

  • grid_size (Optional[Sequence[int]]) – Size of grid to use for interpolation, typically 1.25 to 2 times im_size. Default: 2 * im_size

  • numpoints (Union[int, Sequence[int]]) – Number of neighbors to use for interpolation in each dimension. Default: 6

  • n_shift (Optional[Sequence[int]]) – Size for fftshift. Default: im_size // 2.

  • table_oversamp (Union[int, Sequence[int]]) – Table oversampling factor.

  • kbwidth (float) – Size of Kaiser-Bessel kernel.

  • order (Union[float, Sequence[float]]) – Order of Kaiser-Bessel kernel.

Return type

Tensor

Returns

The density compensation coefficients for ktraj.

Examples

>>> data = torch.randn(1, 1, 12) + 1j * torch.randn(1, 1, 12)
>>> omega = torch.rand(2, 12) * 2 * np.pi - np.pi
>>> dcomp = tkbn.calc_density_compensation_function(omega, (8, 8))
>>> adjkb_ob = tkbn.KbNufftAdjoint(im_size=(8, 8))
>>> image = adjkb_ob(data * dcomp, omega)