Endoscopic retrograde cholangiopancreatography (ERCP) is a technique that combines the use of endoscopy and fluoroscopy to diagnose and treat certain problems of the biliary or pancreatic ductal systems. It is primarily performed by highly skilled and specialty trained gastroenterologists. Through the endoscope, the physician can see the inside of the stomach and duodenum, and inject a contrast medium into the ducts in the biliary tree and pancreas so they can be seen on radiographs. ERCP is used primarily to diagnose and treat conditions of the bile ducts and main pancreatic duct, including gallstones, inflammatory strictures (scars), leaks (from trauma and surgery), and cancer. ERCP can be performed for diagnostic and therapeutic reasons, although the development of safer and relatively non-invasive investigations such as magnetic resonance cholangiopancreatography (MRCP) and endoscopic ultrasound has meant that ERCP is now rarely performed without therapeutic intent.