Hysterosalpingography (HSG) is a specialized X-ray procedure used to examine the inside of the uterus and fallopian tubes. It involves injecting a contrast dye into the uterine cavity through the cervix and taking X-ray images. HSG is commonly used to investigate the causes of infertility, recurrent miscarriages, and to check for any blockages or abnormalities in the fallopian tubes.