An image data set acquired by an optical coherence tomography (OCT) system is corrected for effects due to motion of the sample. A first set of A-scans is acquired within a time short enough to avoid any significant motion of the sample. A second more extensive set of A-scans is acquired over an overlapping region on the sample. A-scans from the first set are matched with A-scans from the second set. Comparison of the OCT scanner coordinates that produced each A-scan in a matching pair reveals the displacement of the sample between acquisition of the first and second A-scans in the pair. Estimates of the sample displacement are used to correct the transverse and longitudinal coordinates of the A-scans in the second set, to form a motion-corrected OCT data set.