Nuclear magnetic imaging of the lungs can be performed using hyperpolarized noble gases. This technique uses resonance of polarized noble gas atoms in an external magnetic field to study the structure of the lungs, which can be used for diagnosing lung diseases. NMR and optical pumping techniques are used to polarize the noble gases for medical imaging applications. Specifically, optical pumping is used to hyperpolarize gases like helium-3 and xenon-129 outside of the MRI scanner, followed by injection into the patient and scanning to generate images of lung structure and function with improved sensitivity over conventional proton imaging.