Magnetic resonance imaging (MRI) is a non-invasive and non-optical measurement technique, which makes it a promising method for studying delicate and opaque samples, such as foam. Another key benefit of MRI is its sensitivity to different nuclei in a sample. The research presented in this article focuses on the use of MRI to measure density and velocity of foam as it passes through a pipe constriction. The foam was created by bubbling fluorinated gas through an aqueous solution. This allowed for the liquid and gas phases to be measured separately by probing the 1H and 19F behavior of the same foam. Density images and velocity maps of the gas and liquid phases of foam flowing through a pipe constriction are presented. In addition, results of computational fluid dynamics simulations of foam flow in the pipe constriction are compared with experimental results.