Based on the Fourier transform relation between diffusion magnetic resonance (MR) signals and the underlying diffusion displacement, a new relation is derived to estimate the spin distribution function (SDF) directly from diffusion MR signals. This relation leads to an imaging method called generalized q-sampling imaging (GQI), which can obtain the SDF from the shell sampling scheme used in q-ball imaging (QBI) or the grid sampling scheme used in diffusion spectrum imaging (DSI). The accuracy of GQI was evaluated by a simulation study and an in vivo experiment in comparison with QBI and DSI. The simulation results showed that the accuracy of GQI was comparable to that of QBI and DSI. The simulation study of GQI also showed that an anisotropy index, named quantitative anisotropy, was correlated with the volume fraction of the resolved fiber component. The in vivo images of GQI demonstrated that SDF patterns were similar to the ODFs reconstructed by QBI or DSI. The tractography generated from GQI was also similar to those generated from QBI and DSI. In conclusion, the proposed GQI method can be applied to grid or shell sampling schemes and can provide directional and quantitative information about the crossing fibers.