Drosophila
 has become a powerful experimental animal for the analysis of neuronal circuits and computations underlying innate behavior.
            In Drosophila
, perturbational genetics is currently combined with the direct recording of neural activity in the CNS and eventually the
            quantitative analysis of behavior. Any deviation of the recorded response from the normal response is indicative of the functional
            role of the manipulated neurons and mechanisms in a specific computation or behavior. In these experiments, strong correlation
            is established by directly recording the membrane potential with electrodes (whole cell recording from the soma) or by optical
            recording changes in the concentration of intracellular calcium. In addition to recordings from the soma, optical measurements
            provide access to subcellular compartments as well as large ensembles of visual interneurons. Furthermore, optical recordings
            are not limited by the small size of the cell body, and neurons located deep inside the brain can be analyzed by using two-photon
            laser scanning microscopy (2PLSM). The latter aspect is of particular importance, as studying vision in flies requires that
            the large compound eyes covering almost the entire head of the fly remain fully intact. However, optical imaging of sensory
            processing in the fly visual system comes along with inherent difficulties of the approach: Fluorescence excitation causes
            blinding of the fly and photons from the visual stimulus enter the detection pathway and corrupt the recorded signals. In
            this chapter, I describe a method and guidelines suitable to bypass these problems. Genetic targeting of a population of visual
            interneurons is used to express a genetically encoded fluorescent indicator for intracellular calcium (GECI). The GECI molecules
            are expressed in the soma as well as all subcellular compartments. Thus, the requirement of dye application is overcome, and
            ultimately, a functionally homogeneous population of neurons can be analyzed with high spatial resolution. Fluorescence of
            the GECI is excited and recorded using in vivo 2PLSM that helps to prevent direct excitation of photoreceptors by laser light.
            Optical recordings are performed during visual stimulation and sensory processing of the fly. By separating fluorescence recording
            and visual stimulus presentation in time, even most subtle changes in GECI fluorescence are captured, while the visual stimulus
            is excluded from the recorded fluorescence signal.