A barium x-ray, also known as a barium swallow or barium enema depending on the procedure, is a diagnostic imaging test used to visualize the gastrointestinal (GI) tract. The procedure involves the ingestion or administration of a barium sulfate contrast material, which enhances the visibility of the GI tract on x-ray images.