Spins that are moving in the same direction as a magnetic field gradient develop a phase shift that is proportional to the velocity of the spins. This is the basis of phase-contrast angiography. In the simplest phase-contrast pulse sequence, bipolar gradients (two gradients with equal magnitude but opposite direction) are used to encode the velocity of the spins. Stationary spins undergo no net change in phase after the two gradients are applied. Moving spins will experience a different magnitude of the second gradient compared to the first, because of its different spatial position. This results in a net phase shift. This information can be used directly to determine the velocity of the spins. Alternatively, the image can be subtracted from one acquired without the velocity encoding gradients to obtain an angiogram.