## 3 Software and Image Processing  
The hypercube contains the spatial (Sx and Sy) and spectral information (S\(\lambda\)). The cube composition shows contiguous subimages, one per wavelength (according to the camera resolution) (Figure 4). Given the three dimensions (Sx, Sy, and S\(\lambda\)), the hypercube can be handled by unfolding the 3D matrix in a 2D matrix and then refolding after mathematical preprocessing and modeling [13]. Due to the large amount of data (wanted/unwanted information and noise) contained in the hypercube, a statistical approach is needed to explore and analyze the information contained. For this purpose, different graphical user interfaces (GUIs) are available on programming platforms like MATLAB, Python, or R. [PERSON] and [PERSON] (2018) proposed an open-source MATLAB-based GUI for hyperspectral image analysis (HYPER-Tools) which integrates fundamental types of spectral and spatial preprocessing methods as well as the main chemometric tools (exploratory data analysis, clustering, regression, and classification) combined with an intuitive process workflow [14]. Thanks to the presence of a powerful visualization provided by MATLAB, such a GUI allows to represent (graphically) a significant amount of information and analyze the results at a glance. An open-source library is available on Python (PyHAT) designed to enable the visualization, thematic image derivation, and spectral analysis of planetary spectral data in a cross-platform [15]. Stand-alone commercial software like ENVI, Unscrambler, and SPSS are also available. ENVI is a powerful remote sensing image processing software that integrates various image processing tools to enhance efficiency. It is preferred for quickly and accurately extracting  
Figure 3: Acquisition modes of a hyperspectral image: (a) point scan; (b) line scan; (c) plan scan; (d) snapshot. Figure 2: Schematic summary of imaging sensing modes: (a) diffuse reflectance; (b) transmittance imaging mode; (c) interactance imaging mode; (d) fluorescence imaging mode; (e) Raman scattering mode. information from hyperspectral images and performing spectral analysis. Unscrambler is a software for multivariate data analysis and experimental design, supporting various analyses, data preprocessing, and real-time visualization. SPSS is used for statistical analysis operations, data mining, and the predictive analysis of hyperspectral data [16]. In order to pick the useful information, the analytical software has to provide the possibility of pretreating the images in order to simultaneously minimize or eliminate unwanted sources of variability (background, redundant information, and artifacts) and maximize information extraction. Firstly, dead pixels and spectra spikes have to be recognized and harmonized. They are generally due to punctual anomalies of the detector that generate pixels that do not record the correct information. Dead pixels are present as missing or zero values, and they can be present singly, in full lines, at specific wavelengths, or throughout the entire spectrum signal. Detecting missing scan lines and dead pixels can be achieved using different algorithms with major or minor complexity (like thresholding techniques, genetic or evolutionary algorithms, or a minimum volume ellipsoid (MVE)). Instead, spikes are unexpected and with high intensity peaks of the signal, and they are usually substituted with the mean or median of a spectral window with the spike point at its center. Once the missing scan lines, dead pixels, and spikes have been detected, one straightforward manner to replace them is using the mean or median of the spectral of the neighboring pixels [17]. Then, the regions of interest (ROI) have to be identified. If the sample does not cover the entire scanned area, the scanned area has to be isolated from the background and the presence of shadows caused by the sample and light source position.