A hysterosalpingogram (HSG) is an X-ray dye test that is used to diagnose reproductive issues. An X-ray is used to capture images of your uterine cavity and fallopian tubes while they are filled with a specific dye during an HSG. An HSG can assist your doctor in detecting problems with your reproductive anatomy that may prevent you from becoming pregnant. Blocked fallopian tubes and an abnormally shaped uterus are among the problems.