Magnetic resonance imaging (MRI) uses powerful magnets to realign a body's atoms, which creates a magnetic field that a scanner uses to create a detailed image of the body.