## 2 Materials and Methods
### Description of the Prototype  
The system that has been designed in this study can acquire NBI images and multispectral images. A standard endoscope (Olympus Exera III) that already exists in most operating rooms is used. Moreover, there are two multispectral cameras (XIMEA based on CMOSIS CMV2000 technology [26]), one in the visible range (450-620 nm) with 16 bands and one in the red and near-infrared (600-1000 nm) with 25 bands. The cameras are connected to a computer with USB 3.0 ports. For convenience, these cameras are respectively called VIS and NIR. To acquire images inside the stomach, a fiberscope (microflex fiberscope from ITConcepts, 2.5 m length, and 2.5 mm thick [27]) is used. The fiberscope contains emitting fibers to illuminate the stomach and receiving fibers to catch images. It is to notice that this fiberscope must be sterilized before each use, this is one of the current limitations as the multispectral system cannot be used during the cleaning of the fiberscope procedure. To connect the fiberscope to the cameras, a beamsplitter system is used (TwinCam from Caim Research [28]). A dichroic filter splits light rays into two according to the wavelength ranges [470-620 nm] and [600-975 nm]. Additionally, a filter is added to avoid Ultraviolet (UV) light. In our case, a 1000 W powerful external light source is needed because the fiber and the sensitivity of the camera induce a loss of intensity. Thus, a Mercury-Xenon light source controlled by a controller device helps to illuminate the stomach (Newport reference: 66924-1000 XF-R1)  
The system must be calibrated spatially and spectrally. The spatial and spectral calibration have been presented in a previous paper [29]. Spatial calibration is needed to correct the radial distortion and to register the NBI image with the multispectral images. The calibration is done by using the tip of the fiberscope, which is visible in the NBI images. Spectral calibration is required because the filters of the cameras are based on the Fabry-Perot structure. They have a primary response but also a secondary response. Moreover, it exists noisy response out of the initial expected wavelength range called crosstalk problem. The calibration has been done by learning a multilinear transformation on a set of patches of the ColorChecker(r). More concretely, the 24 bands ([400, 630 nm] with a step of 10 nm) are deduced from the 16 original bands with the multiplication of a \(16\times 24\) matrix and, in the same way from the 24 bands ([610, 840 nm] with a step of 10 nm) are deduced from the 25 original bands with the multiplication of a \(25\times 24\) matrix. After this transformation, all spectra are normalized according to their \(l_{2}\) norm, meaning that all spectra are divided by their sum of squares.  
In a practical situation, the endoscopist inserts the fiberscope in the operating channel of the endoscope, as described in Figure 2. This operating channel is usually used to insert tools like pincer or cutting/grasping instruments. The endoscopy usually lasts 1 or 2 minutes during which the multispectral cameras acquire images every second approximatively. A specific acquisition software has been developed in C# programming language with.NET 4.5 framework and the library xiAPI that allows the control of the multispectral cameras [30]. This software manages the data saving and adapts the exposition time of the cameras automatically. The cameras have been optically calibrated such that the focus is approximately 2 cm. This distance is the mean distance that exists between the fiberscope tip and the stomach wall.