A myelogram is a diagnostic imaging test that involves injecting contrast dye into the space around the spinal cord to highlight abnormalities like herniated discs or tumors. This procedure helps identify issues affecting the spine and surrounding nerves.