## 2 Materials and Methods
### Data Acquisition and Histopathology Correlation
#### 2.2.2 Lumpectomy Dataset  
The hyperspectral images of 52 lumpectomy specimens from different patients were included in the lumpectomy dataset. A flowchart of the data acquisition of the lumpectomy dataset is shown in Figure 3. The lumpectomy specimen was considered to be a cube and the entire resection surface was divided into six resection sides. Our aim was to obtain a high correlation of the optical measurements with histopathology. Because this is difficult to achieve when imaging the entire resection surface, only one side was selected for the final analysis instead of the entire resection surface. Of the six resection sides, the nipple and peripheral sides were excluded as H & E sections will be taken parallel to the resection surface and will not provide histopathological information on the margin width [17]. To restrict the time required for all optical measurements, the remaining four sides were first imaged with the VIS camera alone and analyzed with the linear discriminant analysis (LDA) classification algorithm developed on tissue slices in our previous study [15]. With this analysis, the resection side was selected that was most likely to contain a tumor-positive margin. Second, this side was imaged with both cameras. Third, on this selected side, up to four locations were marked with black histopathology ink, which remains visible on the H & E sections under the microscope. To increase the chance of marking tumor positive locations, hyperspectral data were classified with an LDA classification algorithm developed on tissue slices (described in reference [15] and Section 2.2.2 and locations were marked on the specimen that were suspected to (1) be tumor positive (IC and/or DCIS), (2) contain connective tissue, or (3) be adipose tissue. Finally, the lump was scanned again with the VIS camera to retrieve the marked locations and the corresponding spectra on the hyperspectral image of the unmarked lump. All optical measurements, as well as selecting the resection side and marking locations, were performed within 25 min after resection. Afterward, the specimen was transferred to the histopathology department and inked according to standard procedure using blue, yellow, red and green ink. Care was taken not to paint over the black ink. The specimen was sliced, and the marked location(s) were indicated on an overview photo of the tissue slices. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Tissue Slices Dataset** & **Lumpectomy Dataset** \\ \hline \multicolumn{2}{c}{**Data acquisition**} & \\ Inclusion & Masteromy and lumpectomy specimen & Lumpectomy specimen \\ Time in clinical workflow & After inking and slicing the specimen & Directly after resection \\ \hline \multicolumn{2}{c}{**Measured surface**} & \\ _cut with_ & Metal knife (at the & \\ pathology department) & Ablation knife (during surgery) \\ _flatness_ & As flat as possible & Spherical shaped \\ \hline \multicolumn{2}{c}{**Histopathology**} & H \& E section parallel & H \& E section perpendicular \\  & to measured side & to measured surface \\ Spatial correlation & High & Low \\ Depth information & Low & High \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Differences in data acquisition and histopathology correlation between tissue slices and lumpectomy specimens. In 3-7 days after surgery, the tissue slices were further processed to H & E sections and digitized using Aperio(r) ScanScope AT2 (Leica Biosystems, Wetzlar, Germany). The tissue up to 1 mm underneath the black marked locations on the resection margin was analyzed to obtain the percentage of IC, DCIS, connective tissue and adipose tissue underneath the marked locations. To annotate IC and DCIS on the H & E sections, we used delineations between the two regions of interest. The tissue slices were further processed to H & E sections and digitized using Aperio(r) ScanScope AT2 (Leica Biosystems, Wetzlar, Germany).