An MRI is often preferred when detailed imaging of the brain and spinal cord is required. It is particularly useful in diagnosing conditions like periventricular leukomalacia and assessing the extent of brain damage in cases of hypoxic-ischemic encephalopathy. MRI is also advantageous because it does not involve exposure to ionizing radiation.