The ability to acquire large-scale recordings of neuronal activity in awake and unrestrained animals is needed to provide new insights into how populations of neurons generate animal behavior. We present an instrument capable of recording intracellular calcium transients from the majority of neurons in the head of a freely behaving Caenorhabditis elegans with cellular resolution while simultaneously recording the animal's position, posture, and locomotion. This instrument provides whole-brain imaging with cellular resolution in an unrestrained and behaving animal. We use spinning-disk confocal microscopy to capture 3D volumetric fluorescent images of neurons expressing the calcium indicator GCaMP6s at 6 head-volumes/s. A suite of three cameras monitor neuronal fluorescence and the animal's position and orientation. Custom software tracks the 3D position of the animal's head in real time and two feedback loops adjust a motorized stage and objective to keep the animal's head within the field of view as the animal roams freely. We observe calcium transients from up to 77 neurons for over 4 min and correlate this activity with the animal's behavior. We characterize noise in the system due to animal motion and show that, across worms, multiple neurons show significant correlations with modes of behavior corresponding to forward, backward, and turning locomotion.calcium imaging | large-scale recording | behavior | C. elegans | microscopy H ow do patterns of neural activity generate an animal's behavior? To answer this question, it is important to develop new methods for recording from large populations of neurons in animals as they move and behave freely. The collective activity of many individual neurons appears to be critical for generating behaviors including arm reach in primates (1), song production in zebrafinch (2), the choice between swimming or crawling in leech (3), and decision-making in mice during navigation (4). New methods for recording from larger populations of neurons in unrestrained animals are needed to better understand neural coding of these behaviors and neural control of behavior more generally.Calcium imaging has emerged as a promising technique for recording dynamics from populations of neurons. Calcium-sensitive proteins are used to visualize changes in intracellular calcium levels in neurons in vivo which serve as a proxy for neural activity (5). To resolve the often weak fluorescent signal of an individual neuron in a dense forest of other labeled cells requires a high magnification objective with a large numerical aperture that, consequently, can image only a small field of view. Calcium imaging has traditionally been performed on animals that are stationary from anesthetization or immobilization to avoid imaging artifacts induced by animal motion. As a result, calcium imaging studies have historically focused on small brain regions in immobile animals that exhibit little or no behavior (6).No previous neurophysiological study has attained whole-brain imaging with cellular resolution in a...