Magnetic resonance imaging (MRI) is a non-invasive medical imaging technique that uses strong magnetic fields and radio waves to produce detailed images of the inside of the body. It employs radiofrequency radiation in the presence of magnetic fields to map the internal structure and function of the body. MRI works by aligning water molecules in the body with the magnetic field, applying radio signals to produce signals from tissues, and using gradients to spatially encode the signals to construct cross-sectional images of the body.