The idea of the whole room calorimeter is that the patient is literally locked in an airtight room, given meals through a slot in one wall, and generally observed within an inch of their lives. Cameras monitor how much they move around, how much they sleep, and so on. (Julia Belluz at Vox published a phenomenal piece about her experience inside one as a control in a metabolism study). It's based on the principle that the rate at which you take in oxygen and exhale carbon dioxide, as well as the rate at which you exchange other gases and body heat, is directly tied to how quickly you're burning energy. When you need fuel, your body creates it in the form of a molecule called ATP. The chemical reaction to make ATP spits out carbon dioxide as a waste product, so when your metabolism goes up your carbon dioxide production should too.