A transesophageal echocardiogram (TEE) is a specialized ultrasound test that provides detailed images of the heart by inserting a probe into the esophagus.