Preparation for diagnostic imaging tests depends on the type of test being performed. For X-rays and ultrasound, little to no preparation is usually required. For CT and MRI scans, you may need to avoid eating or drinking for a few hours before the test. You may also need to remove any metal objects and inform your doctor if you have any implants or medical conditions. For PET scans, you may need to follow a special diet and avoid strenuous activities before the test.