Mapping flows in vivo is essential for the investigation of cardiovascular pathologies in animal models.The limitation of optical-based methods, such as space-time cross correlation, is the scattering of light by the connective and fat components and the direct wave front distortion by large inhomogeneities in the tissue. Nonlinear excitation of the sample fluorescence helps us by reducing light scattering in excitation. However, there is still a limitation on the signal-background due to the wave front distortion. We develop a diffractive optical microscope based on a single spatial light modulator (SLM) with no movable parts. We combine the correction of wave front distortions to the cross-correlation analysis of the flow dynamics. We use the SLM to shine arbitrary patterns of spots on the sample, to correct their optical aberrations, to shift the aberration corrected spot array on the sample for the collection of fluorescence images, and to measure flow velocities from the cross-correlation functions computed between couples of spots. The setup and the algorithms are tested on various microfluidic devices. By applying the adaptive optics correction algorithm, it is possible to increase up to 5 times the signalto-background ratio and to reduce approximately of the same ratio the uncertainty of the flow speed measurement. By working on grids of spots, we can correct different aberrations in different portions of the field of view, a feature that allows for anisoplanatic aberrations correction. Finally, being more efficient in the excitation, we increase the accuracy of the speed measurement by employing a larger number of spots in the grid despite the fact that the two-photon excitation efficiency scales as the fourth power of this number: we achieve a twofold decrease of the uncertainty and a threefold increase of the accuracy in the evaluation of the flow speed. © The Authors. Published by SPIE under a Creative Commons Attribution 4.0 Unported License. Distribution or reproduction of this work in whole or in part requires full attribution of the original publication, including its DOI.