The availability of spatial light modulators as standard turnkey components and their ongoing development makes them attractive for a huge variety of optical measurement systems in industry and research. Here, we outline two examples of how optical measurements can benefit from spatial light modulators. Ultrasound testing has become an indispensable tool for industrial inspection. Contact-free measurements can be achieved by laser-induced ultrasound. One disadvantage is that due to the highly divergent sound field of the generated shear waves for a point-wise thermoelastic excitation, only a poor spatial selectivity can be achieved. This problem can be solved by creating an ultrasound focus by means of a ring-like laser intensity distribution, but standard fixed-form optical components used for their generation are always optimised to a fixed set of parameters. Here, we demonstrate, how a predefined intensity pattern as e.g. a ring can be created from an arbitrary input laser beam using a phase-retrieval algorithm to shape an ultrasound focus in the sample. By displaying different patterns on the spatial light modulator, the focus can be traversed in all three directions through the object allowing a fast and highly spatially resolving scanning of the sample. Optical measurements take often place under difficult conditions. They are affected by variations of the refractive index, caused e.g. by phase boundaries between two media of different optical density. This will result in an increased measurement uncertainty or, in the worst case, will cause the measurement to fail. To overcome these limitations, we propose the application of adaptive optics. Optical flow velocity measurements based on image correlation in water that are performed through optical distortions are discussed. We demonstrate how the measurement error induced by refractive index variations can be reduced if a spatial light modulator is used in the measurement setup to compensate for the wavefront distortions.