a) Experimental schematic for perturbations. Cells grown on BIO-133 were placed on PDMS wells and were either perturbed by flowing 0.05 mM CCCP or left as controls (top higher magnification view). Alternatively, worms were embedded in PEG-DA bonded to a PDMS flow chip and imaged through a layer of BIO-133 (middle higher magnification view) to examine response to chemical stimulation; or embedded in BIO-133, repetitively stimulated with red light from lower, 4x objective and imaged using upper diSPIM objectives (bottom higher magnification view). See also Supplementary Figs. 12–14. b) Example cells with (left column) and without (right column) CCCP treatment at early (top, 0 min) and late (bottom, 70 min) time points. CCCP was added at 10 minutes. Maximum intensity projections of deconvolved diSPIM data are shown. Scale bar: 10 μm. See also Supplementary Video 9. c) Higher magnification views of yellow (left column) and blue (right column) regions in b). Yellow arrowhead shows CCCP-induced morphological change of mitochondrion. Scale bar: 5 μm. d) Example images of worms expressing GCaMP immobilized in PEG-DA disk with (bottom) and without (top) 1.1 μM diacetyl. Fluorescein added to stimulus highlights the rapid addition/removal of chemical. Scale bar: 500 μm. Right schematics show layered structure of assembly, including direction of flow and diffusion (arrowheads) into PEG-DA layer. Line plots show intensity of fluorescein over time in channel (red) and PEG-DA (blue) layers. e) Top: dF/F heatmaps derived from widefield microscopy measurements from 15 animals (rows) in response to 10 repeated stimulus pulses (once per minute). Bottom: responses averaged over all animals show neural adaptation. f) Single-view diSPIM images recorded from a single animal, showing subcellular response in AWA neuron to 1.1 μM diacetyl compared to control (buffer flow) conditions. Contrast has been adjusted to better highlight the response from different cell regions. Scale bar: 10 μm. See also Supplementary Video 10. g) Graphs show average intensity from boxed regions in f) highlighting fluorescence intensity changes in soma and dendrite. h) Worms expressing Chrimson and GCaMP are repetitively stimulated with red light and imaged using upper diSPIM objectives. Maximum intensity projection of GCaMP fluorescence from single-view diSPIM recordings are shown before (left) and after (right) optogenetic stimulation. Scale bar: 10 μm. See also Supplementary Video 11. i) dF/F traces for dendrite, axon, and soma, corresponding to boxed regions in h).