Your doctor may suggest an endoscopic ultrasound to help diagnose the cause of abdominal pain, abnormal weight loss, or to evaluate suspicious lumps or lesions. Endoscopy provides your doctor with detailed images of your digestive tract and can also help detect diseases of the pancreas, bile duct and gallbladder.