Schematic of microfluidic device (left) and 4X zoom of left-most imaging chamber (right). The worm trap microfluidic device is assembled out of a PDMS chip with microchannels engraved on its surface and a 35 × 50 mm #1.5 microscope coverslip, which seals the microchannels (not shown). The microchannels of the device are of three different depths, 10, 50, and 750 µm (shown in red, green, and cyan, respectively). The 10 and 50 µm deep microchannels form a liquid-filled network with one inlet and one outlet as indicated that is surrounded by a separate O-shaped 750 µm deep channel (cyan). This last channel serves as a vacuum cup. When the chip is sealed with a coverslip, and vacuum is applied to this 750 µm deep channel (through a dedicated vacuum port) the chip and coverslip are pulled together. The application of vacuum also leads to partial collapse of all channels of the device, including the liquid-filled microchannels, making it possible to dynamically reduce the microchannel depth in a controlled way by adjusting the level of vacuum. The main functional elements of the liquid-filled microchannel network are the three identical 3.7 × 3 mm imaging chambers, one of which is highlighted in zoom panel, which are 50 µm deep and have rounded corners. The 50 µm depth (as well as somewhat reduced depths of 40–45 µm, when the chambers partially collapse under a low vacuum of −5 kPa) was empirically found to be sufficient for larval and young adult worms to move freely and feed. The imaging chambers are connected to each other and to the device inlet and outlet through capillary microchannels with cross-sections of 10 × 10 µm. The small cross-section of these capillary microchannels makes it impossible for worms to enter them. Hence, worms cannot escape from the imaging chambers. The inlet and outlet are connected to the capillary microchannels through 50 µm deep, 300 µm wide L-shaped microchannels. Relatively low fluidic resistance of these last microchannels (as compared with the 10 × 10 µm capillaries) facilitates even distribution of flow between the capillaries and even perfusion of the imaging chambers with bacterial suspension, which introduced via the inlet.