  The Gridding algorithm has shown great utility for reconstructing images from
non-uniformly spaced samples in the Fourier domain in several imaging
modalities. Due to the non-uniform spacing, some correction for the variable
density of the samples must be made. Existing methods for generating density
compensation values are either sub-optimal or only consider a finite set of
points (a set of measure 0) in the optimization. This manuscript presents the
first density compensation algorithm for a general trajectory that takes into
account the point spread function over a set of non-zero measure. We show that
the images reconstructed with Gridding using the density compensation values of
this method are of superior quality when compared to density compensation
weights determined in other ways. Results are shown with a numerical phantom
and with magnetic resonance images of the abdomen and the knee.
