Optogenetic stimulation is used to excite or inhibit targeted neurons that express the opsin, using an optic fiber. (A) In this example, light delivered through an optic fiber is used to excite only neurons that express the opsin, ChR2, in the path of the light. A given light pulse excites an action potential in neurons expressing the opsin (inset top), but not in neurons lacking opsin expression or out of the range of the delivered light (inset bottom). (B) The opsin is typically introduced to the neurons by injecting a virus containing the opsin gene (top). After about 3 weeks to allow for expression of the opsin, neuron bodies (bottom left) or axon terminals (bottom right) can be targeted with light from the optic fiber to determine which downstream targets are affected.