A hysterosalpingogram (HSG) is a specialized X-ray procedure used primarily to evaluate the shape and patency of the uterus and fallopian tubes. It involves the injection of a contrast dye through the cervix, allowing radiologists to visualize the internal structure of these reproductive organs.