Described herein are methods and devices for performing gastrointestinal surgical procedures using near infrared (nIR) imaging techniques. Described herein are imaging systems, endoscopes, and methods making use of near infrared (nIR) imaging techniques. The imaging systems, endoscopes, and methods can be used, for example, in endoscopic retrograde cholangiopancreatography (ERCP) for visualization of the intraduodenal portion of the bile duct, and in procedures to visualize and to direct treatment of bleeding ulcers, gastrointestinal bleeding, and tumors, for example, a pancreatic mass.