Magnetic resonance imaging (MRI) uses powerful magnets and radio waves to generate detailed images of organs and tissues within the body. MRI machines excite hydrogen atoms in the body using radio waves and a magnetic field, causing the atoms to emit signals as they relax. These signals can be used to construct cross-sectional images of tissues and organs inside the body.