Magnetic resonance imaging (MRI) of the head is a painless, noninvasive test that produces detailed images of your brain and brain stem. The test is carried out with an MRI machine, which produces the images using a magnetic field and radio waves.This test is also known as a brain MRI or a cranial MRI.n MRI is different from a computed tomography (CT) scan or an X-ray in that it does not use radiation to produce images. The images can be combined to form a 3-D picture of your internal structures, so the MRI is more effective than other scans at detecting abnormalities in the pituitary gland and brain stem.