Magnetic resonance imaging (MRI) involves creating a magnetic field around the brain that causes a realignment of hydrogen atoms (specifically, the hydrogen nuclei) in the brain. These realigned hydrogen atoms are then used to create detailed images of the brain's internal structures.