We present a numerical approach to extract the dispersion mismatch in ultrahigh-resolution Fourier domain optical coherence tomography (OCT) imaging of the retina. The method draws upon an analogy with a Shack-Hartmann wavefront sensor. By exploiting mathematical similarities between the expressions for aberration in optical imaging and dispersion mismatch in spectral / Fourier domain OCT, Shack-Hartmann principles can be extended from the two-dimensional paraxial wavevector space (or the x-y plane in the spatial domain) to the one-dimensional wavenumber space (or the z-axis in the spatial domain). For OCT imaging of the retina, different retinal layers, such as the retinal nerve fiber layer (RNFL), the photoreceptor inner and outer segment junction (IS/OS), or all the retinal layers near the retinal pigment epithelium (RPE) can be used as point source beacons in the axial direction, analogous to point source beacons used in conventional two-dimensional Shack-Hartman wavefront sensors for aberration characterization. Subtleties regarding speckle phenomena in optical imaging, which affect the Shack-Hartmann wavefront sensor used in adaptive optics, also occur analogously in this application. Using this approach and carefully suppressing speckle, the dispersion mismatch in spectral / Fourier domain OCT retinal imaging can be successfully extracted numerically and used for numerical dispersion compensation to generate sharper, ultrahigh-resolution OCT images.