We present an optogenetic illumination system capable of real-time light delivery with high spatial resolution to specified targets in freely moving Caenorhabditis elegans. A tracking microscope records the motion of an unrestrained worm expressing channelrhodopsin-2 or halorhodopsin in specific cell types. Image processing software analyzes the worm's position in each video frame, rapidly estimates the locations of targeted cells and instructs a digital micromirror device to illuminate targeted cells with laser light of the appropriate wavelengths to stimulate or inhibit activity. Because each cell in an unrestrained worm is a rapidly moving target, our system operates at high speed (∼50 frames per second) to provide high spatial resolution (∼30 μm). To test the accuracy, flexibility and utility of our system, we performed optogenetic analyses of the worm motor circuit, egg-laying circuit and mechanosensory circuits that have not been possible with previous methods.
When placed on a temperature gradient, a Drosophila larva navigates away from excessive cold or heat by regulating the size, frequency, and direction of reorientation maneuvers between successive periods of forward movement. Forward movement is driven by peristalsis waves that travel from tail to head. During each reorientation maneuver, the larva pauses and sweeps its head from side to side until it picks a new direction for forward movement. Here, we characterized the motor programs that underlie the initiation, execution, and completion of reorientation maneuvers by measuring body segment dynamics of freely moving larvae with fluorescent muscle fibers as they were exposed to temporal changes in temperature. We find that reorientation maneuvers are characterized by highly stereotyped spatiotemporal patterns of segment dynamics. Reorientation maneuvers are initiated with head sweeping movement driven by asymmetric contraction of a portion of anterior body segments. The larva attains a new direction for forward movement after head sweeping movement by using peristalsis waves that gradually push posterior body segments out of alignment with the tail (i.e., the previous direction of forward movement) into alignment with the head. Thus, reorientation maneuvers during thermotaxis are carried out by two alternating motor programs: (1) peristalsis for driving forward movement and (2) asymmetric contraction of anterior body segments for driving head sweeping movement.