Optical recording of the activity of hundreds of individual neurons simultaneously within the functioning brain is now possible with calcium sensitive dyes. This offers a major advance over the limitations of single-unit recording with arrays of microelectrodes, or with functional MRI. However, the analysis of optical activity to understand neuronal interactions and circuitry underlying physiological functions requires new computational approaches. Recently it has been possible to record optically from the distributed population of neurons in the brain stem generating the respiratory rhythm, breath by breath, using the compact brain stem and spinal cord preparation of the fetal mouse stained in vitro with calcium-sensitive dye. The simultaneous electrical activity of phrenic motoneurons that innervate the diaphragm measures the timing of inspiratory breaths. In the present work, fluorescence micrographs taken at 4-100 Hz over 20-40 sec have been analyzed with the simultaneously recorded electrical signal from the phrenic nerve, in a Conditional Random Field framework. This computational analysis will be a useful tool for understanding the cellular circuitry in the living brain controlling fundamental physiological processes.