The least squares quantization table (LSQT) method is proposed to accelerate the direct Fourier transform for reconstructing images from nonuniformly sampled data, similar to the look-up table (LUT) and equal-phase-line (EPL) methods published recently. First, it classifies all the image pixels into several groups using the Lloyd-Max quantization scheme, and stores the representative value of each group in a small-size LSQT in advance. For each k-space data, the contribution is calculated only once for each group. Then, each image pixel is mapped into the nearest group and uses its representative value. The experiments show that the LSQT method requires far smaller memory size than the LUT method. Moreover, it is superior to the EPL and Kaiser-Bessel gridding methods in minimizing reconstruction error and requires fewer complex multiplications than the LUT and EPL methods. Additionally, the inherent parallel structure makes the LSQT method easily adaptable to a multiprocessor system.