bartorch.estimate_density

bartorch.estimate_density#

bartorch.estimate_density()#

Pipe-Menon density compensation weights for a trajectory.

The fixed point \(w \leftarrow w / (C * w)\) of Pipe and Menon [1] is iterated from \(w = 1\), with the convolution \(C * w\) evaluated at the samples by the non-uniform transforms of this package (bartorch.linop.NUFFT). The kernel \(C\) is the squared Dirichlet kernel of the grid shape, the squared point spread function of its field of view: a non-negative kernel one grid cell wide. It is applied as a triangle window on a grid of twice shape. The weights are then scaled so that the density-compensated adjoint of the transform of a uniform image has unit mean modulus.

Parameters:
  • traj (torch.Tensor) – Trajectory (*frames, samples, ndim) in grid units of shape, kx, ky[, kz] with kx along the last image axis, as for nufft(). Each frame is a trajectory of its own and receives its own weights.

  • shape (tuple of int) – Image grid, (y, x) or (z, y, x), relative to which the density is estimated.

  • iterations (int, default=20) – Fixed-point iterations.

Returns:

Real, non-negative weights of shape traj.shape[:-1], for the weights of nufft_adjoint() or bartorch.linop.NUFFT, or the density of bartorch.tools.reconstruct_navigator().

Return type:

torch.Tensor

Raises:

ValueError – If the trajectory does not match the grid’s dimensionality or leaves \(\pm n/2\) along an axis.

References

Examples

>>> weights = estimate_density(traj, (64, 64))  # traj (spokes * samples, 2)

Examples using estimate_density#

Trajectories and transforms

Trajectories and transforms

Off-resonance correction of spiral imaging

Off-resonance correction of spiral imaging

Rigid head motion from navigators

Rigid head motion from navigators