I am trying to understand MRI scanners. I know that MRIs work by aligning the protons in the direction of the large magnetic field and the radio frequency sets the frequency of the oscillations to the lamour frequency - also raising its energy level. Then when the RF is switched off, the energy level drops by releasing radio waves instead which are detected by the same coil that emitted them in the first place. I do not see where the gradient magnets come into this. I know the help with location of the atoms but how? Thanks.