The introduction of fluorescent probes, light sensitive molecules and the recent development of optogenetics are tremendously contributing to our understanding of neuronal circuit function. In parallel with the development of these optical tools, new technologies for the illumination of neural tissue with complex spatio-temporal patterns have been introduced. Here we describe a method for generating spatially-modulated illumination by using Liquid Crystal On Silicon Spatial Light Modulators (LCOS-SLMs). The theoretical background and the description of the working principles of LCOS-SLMs are presented together with a detailed experimental procedure to install LCOS-SLMs on conventional two-photon laser scanning microscopes and perform experiments on neuronal cells. In combination with the development of light-sensitive proteins with cell-specific and subcellularly-localized expression, this technical approach has the potential to open new horizons for the optical investigation of neuronal circuits.