Gadolinium-enhanced MRI of the brain and orbits is done for patients who have eye pain with movement or afferent pupillary defect, particularly with optic nerve swelling on ophthalmoscopy, to diagnose multiple sclerosis.